[Patch V10] i2c: imx: add runtime pm support to improve the performance

2015-12-10 Thread Gao Pan
: real 1m7.735s user 0m0.488s sys 0m20.040s With the patch the same test case (many eeprom reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan Acked-by: Uwe Kleine-König --- V2: As Uwe Kleine-König's suggestion, the versi

[Patch V2] i2c: imx: init bus recovery info before adding i2c adapter

2015-12-08 Thread Gao Pan
such case, when i2c_generic_gpio_recovery() is used for bus recovery, there will be kernel crash because bri->set_scl is NULL. The solution to this bug is moving i2c_imx_init_recovery_info() before i2c_register_adapter(). Signed-off-by: Gao Pan Signed-off-by: Fugang Duan --- V2: -base on

[Patch V1] i2c: imx: init bus recovery info before adding i2c adapter

2015-12-04 Thread Gao Pan
such case, when i2c_generic_gpio_recovery() is used for bus recovery, there will be kernel crash because bri->set_scl is NULL. The solution to this bug is moving i2c_imx_init_recovery_info() before i2c_register_adapter(). Signed-off-by: Gao Pan Signed-off-by: Fugang Duan --- drivers/i2c/busses/

[Patch V1] imx: i2c: fix i2c resource leak with dma transfer

2015-12-02 Thread Gao Pan
In i2c_imx_dma_xfer(), when dmaengine_prep_slave_single() returns NULL, the context goto label err_desc and then return. However, the memory allocated by dmaengine_prep_slave_single() has not been freed yet, which leads to resource leak. (reported by coverity check) Signed-off-by: Gao Pan

[Patch V1] i2c: imx: improve code readability

2015-11-02 Thread Gao Pan
Replace of_get_named_gpio_flags with of_get_named_gpio because the latter has less parameters, which improves code readability. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- drivers/i2c/busses/i2c-imx.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers

[Patch V9] i2c: imx: add runtime pm support to improve the performance

2015-10-25 Thread Gao Pan
: real 1m7.735s user 0m0.488s sys 0m20.040s With the patch the same test case (many eeprom reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- V2: As Uwe Kleine-König's suggestion, the version do below changes:

[Patch V8] i2c: imx: implement bus recovery

2015-10-23 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan Signed-off-by: Sascha Hauer --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -replace of_get_named_gpio() with devm_gpiod_get_opt

[Patch V8] i2c: imx: implement bus recovery

2015-10-18 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan Signed-off-by: Sascha Hauer --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -replace of_get_named_gpio() with devm_gpiod_get_opt

[Patch V7] i2c: imx: implement bus recovery

2015-10-14 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan Signed-off-by: Sascha Hauer --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -replace of_get_named_gpio() with devm_gpiod_get_opt

[Patch V6] i2c: imx: implement bus recovery

2015-09-21 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -replace of_get_named_gpio() with devm_gpiod_get_optional()

[Patch V8] i2c: imx: add runtime pm support to improve the performance

2015-09-18 Thread Gao Pan
reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -call clk_prepare_enable in probe to avoid never enabling clock if CONFIG_PM is disabled -enable

[Patch V5] ARM: dts: imx6qdl-sabresd: add i2c pinctrl gpio state for bus recovery

2015-09-11 Thread Gao Pan
gpio state. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi index 944eb81..6e97018 100644

[Patch V5] i2c: imx: implement bus recovery

2015-09-11 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -replace of_get_named_gpio() with devm_gpiod_get_optional()

[Patch V7] i2c: imx: add runtime pm support to improve the performance

2015-09-08 Thread Gao Pan
reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -call clk_prepare_enable in probe to avoid never enabling clock if CONFIG_PM is disabled -enable

[Patch V7] i2c: imx: add runtime pm support to improve the performance

2015-08-31 Thread Gao Pan
reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan [wsa: fixed some indentation] Signed-off-by: Wolfram Sang --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -call clk_prepare_enable in probe to

[Patch V6] i2c: imx: add runtime pm support to improve the performance

2015-08-27 Thread Gao Pan
reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan [wsa: fixed some indentation] Signed-off-by: Wolfram Sang --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -call clk_prepare_enable in probe to

[Patch V5] i2c: imx: add runtime pm support to improve the performance

2015-08-25 Thread Gao Pan
reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan [wsa: fixed some indentation] Signed-off-by: Wolfram Sang --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -call clk_prepare_enable in probe to

[Patch V4] i2c: imx: add runtime pm support to improve the performance

2015-08-24 Thread Gao Pan
reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: Fugang Duan Signed-off-by: Gao Pan [wsa: fixed some indentation] Signed-off-by: Wolfram Sang --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -call clk_prepare_enable in probe to

[Patch v4] i2c: imx: implement bus recovery

2015-08-19 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -replace of_get_named_gpio() with devm_gpiod_get_optional()

[Patch v3] i2c: imx: implement bus recovery

2015-08-19 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- V2: As Uwe Kleine-König's suggestion, the version do below changes: -replace of_get_named_gpio() with devm_gpiod_get_optional()

[Patch V3] i2c: imx: add runtime pm support to improve the performance

2015-08-02 Thread Gao Pan
- enable clock before request IRQ in probe - remove the pm staff in i2c_imx_isr V3: - pm_runtime_get_sync returns < 0 as error Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- drivers/i2c/busses/i2c-imx.c | 76 +--- 1 file changed, 65 insert

[Patch v2] i2c: imx: implement bus recovery

2015-07-16 Thread Gao Pan
epare callback -use 0 and 1 as return value for the get_scl and get_sda callbacks Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- Documentation/devicetree/bindings/i2c/i2c-imx.txt | 4 + drivers/i2c/busses/i2c-imx.c | 104 -- 2 files changed

[Patch v1] i2c: imx: implement bus recovery

2015-07-13 Thread Gao Pan
clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- Documentation/devicetree/bindings/i2c/i2c-imx.txt | 4 + drivers/i2c/busses/i2c-imx.c | 102 +- 2 files changed

[Patch v2] i2c: imx: add runtime pm support to improve the performance

2015-06-18 Thread Gao Pan
- enable clock before request IRQ in probe - remove the pm staff in i2c_imx_isr Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- drivers/i2c/busses/i2c-imx.c | 76 +--- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/busses/i2c

[Patch v1] i2c: imx: add runtime pm support to improve the performance

2015-06-10 Thread Gao Pan
reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s >From the test result, the patch get better performance. Signed-off-by: Fugang Duan Signed-off-by: Gao Pan --- drivers/i2c/busses/i2c-imx.c | 78 +--- 1 file changed, 66 insertions(+),