[PATCH RFC] i2c: omap: Remove the OMAP_I2C_IP_VERSION_*

2012-11-26 Thread Shubhrajyoti D
the common defines to i2c-omap.h to avoid duplication. Signed-off-by: Shubhrajyoti D --- arch/arm/mach-omap2/i2c.c | 16 +++- arch/arm/mach-omap2/omap_hwmod_2420_data.c |1 - arch/arm/mach-omap2/omap_hwmod_2430_data.c |1 - arch/arm/mach-omap2

[PATCHv2] i2c: omap: Remove the OMAP_I2C_FLAG_RESET_REGS_POSTIDLE flag

2012-11-26 Thread Shubhrajyoti D
The OMAP_I2C_FLAG_RESET_REGS_POSTIDLE is not used anymore in the i2c driver. Remove the flag. Signed-off-by: Shubhrajyoti D --- Has dependency on the below patch http://git.pengutronix.de/?p=wsa/linux.git;a=commitdiff;h=554c96744afd169886bd6fc2736fb0d9aaf634e8 arch/arm/mach-omap2

[PATCH] i2c: omap: Remove the OMAP_I2C_FLAG_RESET_REGS_POSTIDLE flag

2012-11-26 Thread Shubhrajyoti D
The OMAP_I2C_FLAG_RESET_REGS_POSTIDLE is not used anymore in the i2c driver. Remove the flag. Signed-off-by: Shubhrajyoti D --- Has dependency on the below patch http://git.pengutronix.de/?p=wsa/linux.git;a=commitdiff;h=554c96744afd169886bd6fc2736fb0d9aaf634e8 arch/arm/mach-omap2

[PATCH] i2c: omap: Remove the OMAP_I2C_FLAG_RESET_REGS_POSTIDLE flag

2012-11-26 Thread Shubhrajyoti D
The OMAP_I2C_FLAG_RESET_REGS_POSTIDLE is not used anymore in the i2c driver. Remove the flag. Signed-off-by: Shubhrajyoti D --- Has dependency on the below patch http://git.pengutronix.de/?p=wsa/linux.git;a=commitdiff;h=554c96744afd169886bd6fc2736fb0d9aaf634e8 arch/arm/mach-omap2

[PATCHv3] i2c: omap: Move the remove constraint

2012-11-15 Thread Shubhrajyoti D
: Shubhrajyoti D --- v2: rebase to the for-next branch v3: Fix a typo drivers/i2c/busses/i2c-omap.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 482c63d..fabcbe1 100644 --- a/drivers/i2c/busses/i2c-omap.c

[PATCHv2] i2c: omap: Move the remove constraint

2012-11-14 Thread Shubhrajyoti D
Currently we just queue the transfer and release the qos constraints, however we donot wait for the transfer to complete to release the constraint. Move the remove constraint after the bus busy as we are sure that the transfers are completed by then. Signed-off-by: Shubhrajyoti D --- v2: rebase

[PATCH] i2c: omap: Move the remove constraint

2012-11-06 Thread Shubhrajyoti D
Currently we just queue the transfer and release the qos constraints, however we donot wait for the transfer to complete to release the constraint. Move the remove constraint after the bus busy as we are sure that the transfers are completed by then. Signed-off-by: Shubhrajyoti D --- drivers

[PATCHv3 3/8] i2c: omap: remove the dtrev

2012-11-05 Thread Shubhrajyoti D
The dtrev is used only for the comments. Remove the same and use the scheme instead to know if it is version2. Signed-off-by: Shubhrajyoti D --- v3: remove the scheme from the commments. todo: remove the dtrev from hwmod etc. drivers/i2c/busses/i2c-omap.c | 12 +--- 1 files changed

[PATCHv3 5/8] i2c: omap: re-factor omap_i2c_init function

2012-11-05 Thread Shubhrajyoti D
re-factor omap_i2c_init() so that we can re-use it for resume. While at it also remove the bufstate variable as we write it in omap_i2c_resize_fifo for every transfer. Reviewed-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 75

[PATCHv3 1/8] i2c: omap: Fix the revision register read

2012-11-05 Thread Shubhrajyoti D
een added in the resume handler to prevent the access before the setting of the regs. Signed-off-by: Shubhrajyoti D --- v3: Fix the comments. drivers/i2c/busses/i2c-omap.c | 61 - 1 files changed, 48 insertions(+), 13 deletions(-) diff --git a/drivers/

[PATCHv3 4/8] ARM: i2c: omap: Remove the i207 errata flag

2012-11-05 Thread Shubhrajyoti D
The commit [i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207] uses the revision id instead of the flag. So the flag can be safely removed. Reviewed-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- arch/arm/mach-omap2/omap_hwmod_2430_data.c |3 +-- arch/arm/mach-omap2

[PATCHv3 6/8] i2c: omap: make reset a seperate function

2012-11-05 Thread Shubhrajyoti D
Implement reset as a separate function. This will enable us to make sure that we don't do the calculation again on every transfer. Also at probe the reset is not added as the hwmod is doing that for us. Reviewed-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- todo: reprodue the error

[PATCHv3 7/8] i2c: omap: Restore i2c context always

2012-11-05 Thread Shubhrajyoti D
: Shubhrajyoti D --- Todo: the flag could be deleted if the patch is accepted. drivers/i2c/busses/i2c-omap.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 7393017..25f1564 100644 --- a/drivers/i2c/busses/i2c

[PATCHv3 8/8] i2c: omap: cleanup the sysc write

2012-11-05 Thread Shubhrajyoti D
the cases the minor values of the 2430 register is different(0x37) in that case the autoidle setting may be missed. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 20 +--- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCHv3 0/7] i2c: omap: updates

2012-11-05 Thread Shubhrajyoti D
: Linux 3.7-rc4 (2012-11-04 11:07:39 -0800) are available in the git repository at: git://gitorious.org/linus-tree/linus-tree.git i2c_omap/for_3.8 Shubhrajyoti D (8): i2c: omap: Fix the revision register read i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207

[PATCHv3 2/8] i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207

2012-11-05 Thread Shubhrajyoti D
The errata i207 is enabled for 2430 and 3xxx. Use the revision check to enable the erratum instead. Reviewed-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c

[PATCHv2 3/7] i2c: omap: remove the dtrev

2012-11-04 Thread Shubhrajyoti D
The dtrev is used only for the comments. Remove the same and use the scheme instead to know if it is version2. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b

[PATCHv2 6/7] i2c: omap: make reset a seperate function

2012-11-04 Thread Shubhrajyoti D
Implement reset as a separate function. This will enable us to make sure that we don't do the calculation again on every transfer. Also at probe the reset is not added as the hwmod is doing that for us. Signed-off-by: Shubhrajyoti D --- todo: reprodue the errors and optimise the res

[PATCHv2 2/7] i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207

2012-11-04 Thread Shubhrajyoti D
The errata i207 is enabled for 2430 and 3xxx. Use the revision check to enable the erratum instead. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c

[PATCHv2 1/7] i2c: omap: Fix the revision register read

2012-11-04 Thread Shubhrajyoti D
een added in the resume handler to prevent the access before the setting of the regs. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 61 - 1 files changed, 48 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/driv

[PATCHv2 4/7] ARM: i2c: omap: Remove the i207 errata flag

2012-11-04 Thread Shubhrajyoti D
The commit [i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207] uses the revision id instead of the flag. So the flag can be safely removed. Signed-off-by: Shubhrajyoti D --- arch/arm/mach-omap2/omap_hwmod_2430_data.c |3 +-- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |9

[PATCHv2 5/7] i2c: omap: re-factor omap_i2c_init function

2012-11-04 Thread Shubhrajyoti D
re-factor omap_i2c_init() so that we can re-use it for resume. While at it also remove the bufstate variable as we write it in omap_i2c_resize_fifo for every transfer. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 75 +++-- 1 files

[PATCHv2 0/7] i2c: omap: updates

2012-11-04 Thread Shubhrajyoti D
after enabling hwmod Also available through git://gitorious.org/linus-tree/linus-tree.git i2c_omap/for_3.8 Shubhrajyoti D (7): i2c: omap: Fix the revision register read i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207 i2c: omap: remove the dtrev ARM: i2c: omap: Remove the

[PATCHv2 7/7] i2c: omap: Restore i2c context always

2012-11-04 Thread Shubhrajyoti D
reset is done. However the restore never happens as it is dependent on the POSTIDLE flag. The other option would be to call a restore in the reset case. As there are only a few registers to be restored the penalty in the idle case should not be much. Signed-off-by: Shubhrajyoti D --- Todo: the flag

[PATCH 1/2] i2c: omap: Fix the revision register read

2012-11-02 Thread Shubhrajyoti D
een added in the resume handler to prevent the access before the setting of the regs. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 59 - 1 files changed, 46 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/driv

[PATCH 0/2] i2c: omap: revision register updates

2012-11-02 Thread Shubhrajyoti D
. Shubhrajyoti D (2): i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207 i2c: omap: Fix the revision register read drivers/i2c/busses/i2c-omap.c | 62 +++- 1 files changed, 48 insertions(+), 14 deletions(-) -- 1.7.5.4 -- To unsubscribe from this

[PATCH 2/2] i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207

2012-11-02 Thread Shubhrajyoti D
The errata i207 is enabled for 2430 and 3xxx. Use the revision check to enable the erratum instead. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c

[PATCH RFC] i2c: omap: Fix the revision register read

2012-10-31 Thread Shubhrajyoti D
-by: Shubhrajyoti D --- todo: some of the flag checks can be removed in favour of revision check. drivers/i2c/busses/i2c-omap.c | 35 +-- 1 files changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c in

[PATCHv4 1/2] i2c: omap: re-factor omap_i2c_init function

2012-10-25 Thread Shubhrajyoti D
re-factor omap_i2c_init() so that we can re-use it for resume. While at it also remove the bufstate variable as we write it in omap_i2c_resize_fifo for every transfer. Signed-off-by: Shubhrajyoti D --- v4: add spaces for readability drivers/i2c/busses/i2c-omap.c | 74

[PATCHv4 0/2] i2c: omap: cleanups

2012-10-25 Thread Shubhrajyoti D
Applies on Felipe's series http://www.spinics.net/lists/linux-omap/msg79995.html Tested with Terro sys fix + Felipe's stop sched_clock() during suspend on omap3630 beagle both idle and suspend. Functional testing on omap4sdp. Todo: all the error cases may not need a reset. Shubhra

[PATCHv4 2/2] i2c: omap: make reset a seperate function

2012-10-25 Thread Shubhrajyoti D
Implement reset as a separate function. This will enable us to make sure that we don't do the calculation again on every transfer. Also at probe the reset is not added as the hwmod is doing that for us. Signed-off-by: Shubhrajyoti D --- some of the errors may not need a reset. will chec

[PATCHv4 1/2] i2c: omap: re-factor omap_i2c_init function

2012-10-25 Thread Shubhrajyoti D
re-factor omap_i2c_init() so that we can re-use it for resume. While at it also remove the bufstate variable as we write it in omap_i2c_resize_fifo for every transfer. Signed-off-by: Shubhrajyoti D --- v4: add spaces for readability drivers/i2c/busses/i2c-omap.c | 74

[PATCHv4 0/2] i2c: omap: cleanups

2012-10-25 Thread Shubhrajyoti D
Applies on Felipe's series http://www.spinics.net/lists/linux-omap/msg79995.html Tested with Terro sys fix + Felipe's stop sched_clock() during suspend on omap3630 beagle both idle and suspend. Functional testing on omap4sdp. Todo: all the error cases may not need a reset. Shubhra

[PATCHv4 2/2] i2c: omap: make reset a seperate function

2012-10-25 Thread Shubhrajyoti D
Implement reset as a separate function. This will enable us to make sure that we don't do the calculation again on every transfer. Also at probe the reset is not added as the hwmod is doing that for us. Signed-off-by: Shubhrajyoti D --- some of the errors may not need a reset. will chec

[PATCH 1/2] i2c: omap: re-factor omap_i2c_init function

2012-10-25 Thread Shubhrajyoti D
re-factor omap_i2c_init() so that we can re-use it for resume. While at it also remove the bufstate variable as we write it in omap_i2c_resize_fifo for every transfer. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 71 ++-- 1 files

[PATCH 0/2] i2c: omap: cleanups

2012-10-25 Thread Shubhrajyoti D
Applies on Felipe's series http://www.spinics.net/lists/linux-omap/msg79995.html Tested with Terro sys fix + Felipe's stop sched_clock() during suspend on omap3630 beagle both idle and suspend. Functional testing on omap4sdp. Shubhrajyoti D (2): i2c: omap: re-factor omap_i2c_ini

[PATCH 2/2] i2c: omap: make reset a seperate function

2012-10-25 Thread Shubhrajyoti D
Implement reset as a seperate function. This will enable us to make sure that we don't do the calculation again on every transfer. Also at probe the reset is not added as the hwmod is doing that for us. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |

[PATCH v2] i2c: omap: re-factor omap_i2c_init function

2012-10-24 Thread Shubhrajyoti D
re-factor omap_i2c_init() so that we can re-use it for resume. While at it also remove the bufstate variable as we write it in omap_i2c_resize_fifo for every transfer. Signed-off-by: Shubhrajyoti D --- v2 - add the iestate 0 check back. - Remove a stray change. - Applies on top of Felipe&#

[PATCH] i2c: omap: re-factor omap_i2c_init function

2012-10-23 Thread Shubhrajyoti D
re-factor omap_i2c_init() so that we can re-use it for resume. While at it also remove the bufstate variable as we write it in omap_i2c_resize_fifo for every transfer. Signed-off-by: Shubhrajyoti D --- Applies on Felipe's series http://www.spinics.net/lists/linux-omap/msg79995.html Tested

[PATCH] char/tpm: Convert struct i2c_msg initialization to C99 format

2012-10-09 Thread Shubhrajyoti D
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Thanks to Julia Lawall for automating the conversion Signed-off-by: Shubhrajyoti D --- drivers/char/tpm

[PATCH] matroxfb: Convert struct i2c_msg initialization to C99 format

2012-10-09 Thread Shubhrajyoti D
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Thanks to Julia Lawall for automating the conversion Signed-off-by: Shubhrajyoti D --- drivers/video/matrox

[PATCH 2/4] input: Convert struct i2c_msg initialization to C99 format

2012-10-09 Thread Shubhrajyoti D
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Thanks to Julia Lawall for automating the conversion Signed-off-by: Shubhrajyoti D --- drivers/input/touchscreen

[PATCH 1/4] input: Convert struct i2c_msg initialization to C99 format

2012-10-09 Thread Shubhrajyoti D
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Thanks to Julia Lawall for automating the conversion Signed-off-by: Shubhrajyoti D --- drivers/input/joystick

[PATCH 3/3] i2c: omap: Remove Address as slave wakeup

2012-10-08 Thread Shubhrajyoti D
Currently the slave support is not there in the current i2c. Lets remove the Address as slave wakeup from the Wakeup enable register. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses

[PATCH 2/3] i2c: omap: Remove the redundant fifo clear

2012-10-08 Thread Shubhrajyoti D
The omap_i2c_resize_fifo already takes care of the fifo clearing so, remove the (re)clearing of the fifo. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c

[PATCH 1/3] i2c: omap: Do not enable the irq always

2012-10-08 Thread Shubhrajyoti D
Enable the irq in the transfer and disable it after the transfer is done. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index b6c6b95

[PATCHv8 09/22] i2c: omap: switch over to do {} while loop

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi this will make sure that we execute at least once. No functional changes otherwise. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 20 ++-- 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a

[PATCHv8 08/22] i2c: omap: re-factor receive/transmit data loop

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi re-factor the common parts to a separate function, so that code is easier to read and understand. No functional changes. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 204 1 files

[PATCHv8 19/22] i2c: omap: switch to threaded IRQ support

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi for OMAP2, we can easily switch over to threaded IRQs on the I2C driver. This will allow us to spend less time in hardirq context. Signed-off-by: Felipe Balbi [Trivial formating changes] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 43

[PATCHv8 22/22] i2c: omap: sanitize exit path

2012-09-12 Thread Shubhrajyoti D
be transferred. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 122f517..b149e32

[PATCHv8 14/22] i2c: omap: always return IRQ_HANDLED

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi Always return IRQ_HANDLED otherwise we could get our IRQ line disabled due to many spurious IRQs. Signed-off-by: Felipe Balbi [Trivial changes to commitlogs] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |2 +- 1 files changed, 1 insertions(+), 1

[PATCHv8 12/22] i2c: omap: bus: add a receiver flag

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi that way we can ignore TX IRQs while in receiver mode and ignore RX IRQs while in transmitter mode. Signed-off-by: Felipe Balbi [Remove unnecessary braces] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |8 1 files changed, 8 insertions(+), 0

[PATCHv8 10/22] i2c: omap: ack IRQ in parts

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi According to flow diagrams on OMAP TRMs, we should ACK the IRQ as they happen. Signed-off-by: Felipe Balbi [Ack the stat OMAP_I2C_STAT_AL in case of arbitration lost] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 28 1

[PATCHv8 00/23]I2C big cleanup

2012-09-12 Thread Shubhrajyoti D
i2c: omap: switch to threaded IRQ support i2c: omap: remove unnecessary pm_runtime_suspended check i2c: omap: switch over to autosuspend API i2c: omap: sanitize exit path Shubhrajyoti D (1): i2c: omap: remove redundant status read drivers/i2c/busses

[PATCHv8 13/22] i2c: omap: simplify errata check

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi omap_i2c_dev is allocated with kzalloc(), so we need not initialize b_hw to zero. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCHv8 16/22] i2c: omap: resize fifos before each message

2012-09-12 Thread Shubhrajyoti D
check for dev->buf_len as we always know the amount of data to be transmitted. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 83 + 1 files changed, 51 insertions(+), 32 deletions(-) diff --git a/dri

[PATCHv8 21/22] i2c: omap: switch over to autosuspend API

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi this helps us reduce unnecessary pm transitions in case we have another i2c message starting soon. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git

[PATCHv8 20/22] i2c: omap: remove unnecessary pm_runtime_suspended check

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi before starting any messages we call pm_runtime_get_sync() which will make sure that by the time we program a transfer and our IRQ handler gets called, we're not suspended anymore. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-o

[PATCHv8 18/22] i2c: omap: remove redundant status read

2012-09-12 Thread Shubhrajyoti D
Currently omap_i2c_ack_stat doesn't use the stat variable. After the read of the I2C_STAT_REG it is not used. Remove the redundant read of the status register. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff

[PATCHv8 06/22] i2c: omap: split out [XR]DR and [XR]RDY

2012-09-12 Thread Shubhrajyoti D
avoid an unncessary register read since dev->fifo_len will always contain the correct amount of data to be transferred. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 126 ++--- 1 files changed, 92 insertion

[PATCHv8 01/22] i2c: omap: switch to devm_* API

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi that helps deleting some boiler plate code and lets driver-core manage our resources for us. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 41 - 1 files changed, 12 insertions(+), 29

[PATCHv8 04/22] i2c: omap: add blank lines

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi trivial patch to aid readability. No functional changes. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c

[PATCHv8 07/22] i2c: omap: improve i462 errata handling

2012-09-12 Thread Shubhrajyoti D
data. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 43 1 files changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 815577b..fb57221 1

[PATCHv8 17/22] i2c: omap: get rid of the "complete" label

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi we can ack stat and complete the command from the errata handling itself. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 16 +--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses

[PATCHv8 03/22] i2c: omap: decrease indentation level on data handling

2012-09-12 Thread Shubhrajyoti D
break; } aaa; Hence no functional changes. Signed-off-by: Felipe Balbi Reviewed-by : Santosh Shilimkar Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 63 - 1 files changed, 31 insertions(+), 32 deletions(-) diff --git a

[PATCHv8 05/22] i2c: omap: simplify omap_i2c_ack_stat()

2012-09-12 Thread Shubhrajyoti D
f-by: Felipe Balbi Reviewed-by : Santosh Shilimkar [Added the explaination from the discurssion to the commit logs] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-o

[PATCHv8 02/22] i2c: omap: simplify num_bytes handling

2012-09-12 Thread Shubhrajyoti D
-off-by: Felipe Balbi Reviewed-by : Santosh Shilimkar Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 2d9b03c..236cb38 100644 --- a

[PATCHv8 15/22] i2c: omap: simplify IRQ exit path

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi instead of having multiple return points, use a goto statement to make that clearer. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 20 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a

[PATCHv8 11/22] i2c: omap: switch to platform_get_irq()

2012-09-12 Thread Shubhrajyoti D
From: Felipe Balbi that's a nice helper from drivers core which will give us the exact IRQ number, instead of a pointer to an IRQ resource. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 12 +++- 1 files changed, 7 insertions(

[PATCHv7 02/23] i2c: omap: simplify num_bytes handling

2012-09-11 Thread Shubhrajyoti D
-off-by: Felipe Balbi Reviewed-by : Santosh Shilimkar Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 2d9b03c..236cb38 100644 --- a

[PATCHv7 17/23] i2c: omap: get rid of the "complete" label

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi we can ack stat and complete the command from the errata handling itself. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 16 +--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses

[PATCHv7 15/23] i2c: omap: simplify IRQ exit path

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi instead of having multiple return points, use a goto statement to make that clearer. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 20 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a

[PATCHv7 22/23] i2c: omap: switch over to autosuspend API

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi this helps us reduce unnecessary pm transitions in case we have another i2c message starting soon. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git

[PATCHv7 23/23] i2c: omap: sanitize exit path

2012-09-11 Thread Shubhrajyoti D
be transferred. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 122f517..b149e32

[PATCHv7 21/23] i2c: omap: remove unnecessary pm_runtime_suspended check

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi before starting any messages we call pm_runtime_get_sync() which will make sure that by the time we program a transfer and our IRQ handler gets called, we're not suspended anymore. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-o

[PATCHv7 12/23] i2c: omap: bus: add a receiver flag

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi that way we can ignore TX IRQs while in receiver mode and ignore RX IRQs while in transmitter mode. Signed-off-by: Felipe Balbi [Remove unnecessary braces] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |8 1 files changed, 8 insertions(+), 0

[PATCHv7 18/23] i2c: omap: remove redundant status read

2012-09-11 Thread Shubhrajyoti D
Remove the redundant read of the status register. Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 5d4bad4..498a462 100644 --- a/drivers

[PATCHv7 20/23] i2c: omap: switch to threaded IRQ support

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi for OMAP2, we can easily switch over to threaded IRQs on the I2C driver. This will allow us to spend less time in hardirq context. Signed-off-by: Felipe Balbi [Trivial formating changes] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 43

[PATCHv7 19/23] i2c: omap: always return IRQ_HANDLED

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi even if our clocks are disabled, we still handled the IRQ, so we should return IRQ_HANDLED. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/i2c

[PATCHv7 16/23] i2c: omap: resize fifos before each message

2012-09-11 Thread Shubhrajyoti D
check for dev->buf_len as we always know the amount of data to be transmitted. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 83 + 1 files changed, 51 insertions(+), 32 deletions(-) diff --git a/dri

[PATCHv7 01/23] i2c: omap: switch to devm_* API

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi that helps deleting some boiler plate code and lets driver-core manage our resources for us. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 41 - 1 files changed, 12 insertions(+), 29

[PATCHv7 08/23] i2c: omap: re-factor receive/transmit data loop

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi re-factor the common parts to a separate function, so that code is easier to read and understand. No functional changes. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 204 1 files

[PATCHv7 14/23] i2c: omap: always return IRQ_HANDLED

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi Always return IRQ_HANDLED otherwise we could get our IRQ line disabled due to many spurious IRQs. Signed-off-by: Felipe Balbi [Trivial changes to commitlogs] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |2 +- 1 files changed, 1 insertions(+), 1

[PATCHv7 11/23] i2c: omap: switch to platform_get_irq()

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi that's a nice helper from drivers core which will give us the exact IRQ number, instead of a pointer to an IRQ resource. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 12 +++- 1 files changed, 7 insertions(

[PATCHv7 09/23] i2c: omap: switch over to do {} while loop

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi this will make sure that we execute at least once. No functional changes otherwise. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 20 ++-- 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a

[PATCHv7 10/23] i2c: omap: ack IRQ in parts

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi According to flow diagrams on OMAP TRMs, we should ACK the IRQ as they happen. Signed-off-by: Felipe Balbi [Ack the stat OMAP_I2C_STAT_AL in case of arbitration lost] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 28 1

[PATCHv7 07/23] i2c: omap: improve i462 errata handling

2012-09-11 Thread Shubhrajyoti D
data. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 43 1 files changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 815577b..fb57221 1

[PATCHv7 13/23] i2c: omap: simplify errata check

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi omap_i2c_dev is allocated with kzalloc(), so we need not initialize b_hw to zero. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c

[PATCHv7 03/23] i2c: omap: decrease indentation level on data handling

2012-09-11 Thread Shubhrajyoti D
break; } aaa; Hence no functional changes. Signed-off-by: Felipe Balbi Reviewed-by : Santosh Shilimkar Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 63 - 1 files changed, 31 insertions(+), 32 deletions(-) diff --git a

[PATCHv7 04/23] i2c: omap: add blank lines

2012-09-11 Thread Shubhrajyoti D
From: Felipe Balbi trivial patch to aid readability. No functional changes. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c

[PATCHv7 06/23] i2c: omap: split out [XR]DR and [XR]RDY

2012-09-11 Thread Shubhrajyoti D
avoid an unncessary register read since dev->fifo_len will always contain the correct amount of data to be transferred. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 126 ++--- 1 files changed, 92 insertion

[PATCHv7 05/23] i2c: omap: simplify omap_i2c_ack_stat()

2012-09-11 Thread Shubhrajyoti D
f-by: Felipe Balbi Reviewed-by : Santosh Shilimkar [Added the explaination from the discurssion to the commit logs] Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-o

[PATCHv7 00/23]I2C big cleanup

2012-09-11 Thread Shubhrajyoti D
ap: switch over to autosuspend API i2c: omap: sanitize exit path Shubhrajyoti D (1): i2c: omap: remove redundant status read drivers/i2c/busses/i2c-omap.c | 442 + 1 files changed, 271 insertions(+), 171 deletions(-) -- 1.7.5.4 -- To unsubscribe fr

[PATCH v2] i2c: omap: Prevent NULL pointer dereference in remove

2012-09-06 Thread Shubhrajyoti D
: Shubhrajyoti D --- v2: Implement Jean's suggestion of not deleting instead make it NULL at a safer time. drivers/i2c/busses/i2c-omap.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 5d19a49..c4

[PATCH] i2c: designware: Fix a possible NULL pointer access

2012-08-23 Thread Shubhrajyoti D
After platform_set_drvdata(pdev, NULL) the pdev->dev should not be accessed. Also since the platform device is deleted anyways just remove the call to platform_set_drvdata(pdev, NULL). Signed-off-by: Shubhrajyoti D --- Untested. drivers/i2c/busses/i2c-designware-platdrv.c |

[PATCH] i2c: davinci: Fix a possible NULL pointer access

2012-08-23 Thread Shubhrajyoti D
After platform_set_drvdata(pdev, NULL) the pdev->dev should not be accessed. Also since the platform device is deleted anyways just remove the call to platform_set_drvdata(pdev, NULL). Signed-off-by: Shubhrajyoti D --- Untested. drivers/i2c/busses/i2c-davinci.c |2 -- 1 files changed

[PATCH] i2c: omap: Prevent NULL pointer dereference in remove

2012-08-23 Thread Shubhrajyoti D
at omap_i2c_runtime_resume+0x8/0x148 Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 5d19a49..84fbef6 100644 --- a/drivers/i2c/busses/i2c-omap.c ++

[PATCHv7 23/24] i2c: omap: sanitize exit path

2012-08-16 Thread Shubhrajyoti D
be transferred. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index d81189a..3df6f92

[PATCHv7 22/24] i2c: omap: switch over to autosuspend API

2012-08-16 Thread Shubhrajyoti D
From: Felipe Balbi this helps us reduce unnecessary pm transitions in case we have another i2c message starting soon. Signed-off-by: Felipe Balbi Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git

[PATCHv7 24/24] i2c: omap: Prevent NULL pointer dereference in remove

2012-08-16 Thread Shubhrajyoti D
/0x148 Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 3df6f92..9aefd36 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses

  1   2   3   4   5   6   >