GitHub/moto-9609/android_kernel_motorola_exynos9610.git
6 years ago[COMMON] watchdog: s3c2410_wdt: moved to subsys_initcall for quick reset support
Changki Kim [Mon, 9 Apr 2018 07:27:26 +0000 (16:27 +0900)]
[COMMON] watchdog: s3c2410_wdt: moved to subsys_initcall for quick reset support

Change-Id: I5497efbf663640122722431e9c1b8b8b5ad8a850
Signed-off-by: Changki Kim <changki.kim@samsung.com>
6 years ago[COMMON] watchdog: s3c2410_wdt: Change PMU mask function
Jaehyoung Choi [Thu, 8 Mar 2018 07:01:50 +0000 (16:01 +0900)]
[COMMON] watchdog: s3c2410_wdt: Change PMU mask function

In Exynos9820, PMU registers were changed.
MASK_RESET register was replaced by NONCPU_INT_EN register.
AUTO_DISABLE register was removed and its value was fixed by 0.

For this reason, new drive data was added and function related
PMU was changed.

Change-Id: I14728441f6869946b2317cd6c63e04e0ca4a8360
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
6 years ago[COMMON] watchdog: s3c2410_wdt: Fix debug code for kernel 4.14
Jaehyoung Choi [Fri, 12 Jan 2018 12:39:32 +0000 (21:39 +0900)]
[COMMON] watchdog: s3c2410_wdt: Fix debug code for kernel 4.14

Change-Id: I7486d531a65859a17e9141c5f5e21ef1ebb4215f
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
6 years ago[COMMON] watchdog: Add watchdog reset confirm function.
Jaehyoung Choi [Thu, 14 Sep 2017 08:55:52 +0000 (17:55 +0900)]
[COMMON] watchdog: Add watchdog reset confirm function.

Currently mainline code does not support functions
to check whether watchdog works in real time.

The reset_confirm function checks
whether the watchdog timer actually generates a reset.

Change-Id: I569ab2f910b63160753838801d3c0b03f5a1a46d
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
6 years ago[COMMON] watchdog: s3c2410_wdt: Add debug log in watchdog function
Jaehyoung Choi [Fri, 12 Jan 2018 06:56:31 +0000 (15:56 +0900)]
[COMMON] watchdog: s3c2410_wdt: Add debug log in watchdog function

Change-Id: I74452d58a2e98efd395ba4efa1c950a1beeac656
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
6 years ago[COMMON] watchdog: s3c2410_wdt: add stutdown disable
hajun.sung [Sun, 27 Aug 2017 04:41:37 +0000 (13:41 +0900)]
[COMMON] watchdog: s3c2410_wdt: add stutdown disable

- When system failure after watchdog driver shutdown,
  there is no way to reboot, just system hang (with black screen).
- To prevent system hang, watchdog must not be disabled after shutdown.
- But sometimes watchdog must be disabled to debug reset sequence.
  So, define with config : S3C2410_SHUTDOWN_REBOOT

- This configuration is recommended for user case.

Change-Id: I2cfcc6d922f2ccd8cd91d0059fb6f79e9fd40854
Signed-off-by: hajun.sung <hajun.sung@samsung.com>
6 years ago[COMMON] watchdog: s3c2410_wdt: Add multistage watchdog solution
Choi Jaehyoung [Mon, 25 Sep 2017 08:30:30 +0000 (17:30 +0900)]
[COMMON] watchdog: s3c2410_wdt: Add multistage watchdog solution

Multistage watchdog is a debugging solution using FIQ
when dumpGPR using reset is not available.

Multistage watchdog has a following policies.

1. Multistage watchdog is big cluster watchdog.
2. When little cluster watchdog is started,
   multistage watchdog is also started.
3. However, if the panic function runs a little cluster watchdog,
   then the multistage watchdog should be turned off.

Change-Id: I0c45d07b80c3b75848b1f1bc3259dc7faf5c63da
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
6 years ago[COMMON] watchdog: s3c2410_wdt: Add watchdog confirm function.
Choi Jaehyoung [Tue, 11 Jul 2017 07:59:32 +0000 (16:59 +0900)]
[COMMON] watchdog: s3c2410_wdt: Add watchdog confirm function.

This function shows the registers associated with the state of the current watchdog.
However, this function does not return, so it must be used only for testing purposes.

Change-Id: Ic666bce8e31c563a7b445f923017990faed92595
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
6 years agoRevert "[COMMON] watchdog: Add watchdog reset confirm function."
Jaehyoung Choi [Thu, 10 May 2018 04:38:13 +0000 (13:38 +0900)]
Revert "[COMMON] watchdog: Add watchdog reset confirm function."

This reverts commit 816981102c4237b5a40746c6a2d0fa3389584ce0.

6 years ago[COMMON] watchdog: s3c2410_wdt: Fix exynos8 drv_data quirks
Jaehyoung Choi [Fri, 12 Jan 2018 10:31:18 +0000 (19:31 +0900)]
[COMMON] watchdog: s3c2410_wdt: Fix exynos8 drv_data quirks

Change-Id: I0dc4405ab8be7464682d696c2f4c14b39a373560
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
6 years ago[COMMON] i2c: s3c2410: Fix build error related to idle ip for kernel 4.14
myung-su.cha [Thu, 10 May 2018 04:57:43 +0000 (13:57 +0900)]
[COMMON] i2c: s3c2410: Fix build error related to idle ip for kernel 4.14

Change-Id: Id3a2249cc53caef0608103039adf0ef6b90ba9da
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[COMMON] i2c: s3c: Add debugging log for Normal i2c
Kyungwoo Kang [Fri, 20 Oct 2017 07:14:34 +0000 (16:14 +0900)]
[COMMON] i2c: s3c: Add debugging log for Normal i2c

Previously we only print "bus idle" log when the bus is busy.
This patch we put I2C STAT SFR info for more convinient debugging.

Change-Id: I9b18366f7bdcdacfec0e7d0ae4b7cc4e26851e73
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: s3c2410: Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS instead of open-coded
Youngmin Nam [Wed, 12 Apr 2017 16:26:47 +0000 (01:26 +0900)]
[COMMON] i2c: s3c2410: Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS instead of open-coded

This patch came from f6903783eba49a2cbb6798b35fcf9d2ce61768b9 in android 4.9

Change-Id: I884ec7e3d58985aa4bb6a7e81539f986ea90b329
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: s3c2410: change QUIRK_FIMC_I2C flag value
Youngmin Nam [Wed, 12 Apr 2017 16:23:51 +0000 (01:23 +0900)]
[COMMON] i2c: s3c2410: change QUIRK_FIMC_I2C flag value

Change-Id: I5df6e46fc4d92853418ab4c244a6bef0aa28f356
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: s3c2410: release debug log in I2C driver
Youngmin Nam [Mon, 21 Nov 2016 06:48:17 +0000 (15:48 +0900)]
[COMMON] i2c: s3c2410: release debug log in I2C driver

Change-Id: Id899e7184d676357e268792a6ab3d25eb834be7a
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: s3c2410: prepare I2C clock once on probe
Youngmin Nam [Mon, 21 Nov 2016 06:42:11 +0000 (15:42 +0900)]
[COMMON] i2c: s3c2410: prepare I2C clock once on probe

Change-Id: I71ac919cc793edbe2dab2587c225d7a3e61fee22
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoi2c: s3c2410: Change CONFIG_PM_RUNTIME to CONFIG_PM
Youngmin Nam [Fri, 29 Apr 2016 07:54:25 +0000 (16:54 +0900)]
i2c: s3c2410: Change CONFIG_PM_RUNTIME to CONFIG_PM

This patch chagnes CONFIG_PM_RUNTIME to CONFIG_PM in exynos normal I2C driver.
This patch shoud be applies to sync with below commit.

commit 464ed18ebdb6236fcff59d2a35d4d2e28668435a
PM: Eliminate CONFIG_PM_RUNTIME
Having switched over all of the users of CONFIG_PM_RUNTIME to use
CONFIG_PM directly, turn the latter into a user-selectable option
and drop the former entirely from the tree.

Change-Id: I2ef02c977eeb783bb3b69d95d284e81379624023
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoi2c: s3c2410: Enable idle ip status
Youngmin Nam [Tue, 21 Apr 2015 17:13:02 +0000 (02:13 +0900)]
i2c: s3c2410: Enable idle ip status

Change-Id: I754fd76eb9dd8c3a223f9e720cee527a265234f0
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoi2c: s3c2410: modify dev_info to dev_dbg
Youngmin Nam [Tue, 25 Aug 2015 02:11:04 +0000 (11:11 +0900)]
i2c: s3c2410: modify dev_info to dev_dbg

Change-Id: I1c07c3a517d9765f7911a83c9ecf0f205350b464
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoi2c: s3c2410: Fix compile error
Youngmin Nam [Mon, 24 Aug 2015 10:44:21 +0000 (19:44 +0900)]
i2c: s3c2410: Fix compile error

Change-Id: I43824c6f1e72aea52da3b6cb8d06e684107a516e
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoi2c: s3c2410: add the new h/w init sequence
Youngmin Nam [Thu, 2 Jul 2015 12:11:13 +0000 (21:11 +0900)]
i2c: s3c2410: add the new h/w init sequence

To recover from "cannot get bus (error -110)" error,
add the new h/w init sequence. This init sequence initialize
i2c bus (sda and scl), through clearing S3C2410_IICSTAT_TXRXEN.

Change-Id: Id76af5a3c4baa18685b3104095fa3eb36942349f
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoi2c: s3c2410: change featuring for compile error
Kisang Lee [Thu, 4 Jun 2015 04:19:23 +0000 (13:19 +0900)]
i2c: s3c2410: change featuring for compile error

Change-Id: Icf4ac66085aca77da09a068a843919f0e4a2218f
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
6 years agoi2c: s3c2410: remove unnecessary codes
Kisang Lee [Thu, 4 Jun 2015 04:15:04 +0000 (13:15 +0900)]
i2c: s3c2410: remove unnecessary codes

Change-Id: Iea4fd40f8e12236f04abcf5771eb014fd1dbf648
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
6 years agoi2c: s3c2410: set 24Mhz to NCLK for fimc_is_i2c
Hyunki Koo [Tue, 22 Jul 2014 13:37:21 +0000 (22:37 +0900)]
i2c: s3c2410: set 24Mhz to NCLK for fimc_is_i2c

Change-Id: I18b8cbcec5a6c8ac8a37235805323755210db6e2
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
6 years agoi2c: s3c24xx: Modification codes to avoid unexpected interrupts
Kisang Lee [Mon, 9 Jun 2014 11:45:01 +0000 (20:45 +0900)]
i2c: s3c24xx: Modification codes to avoid unexpected interrupts

Change-Id: I46ec0faad45d01b0629f1f625044e9a48b105be5
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
6 years agoi2c: s3c2410: set NCLK for FIMC_I2C
Hyunki Koo [Mon, 3 Mar 2014 07:09:30 +0000 (16:09 +0900)]
i2c: s3c2410: set NCLK for FIMC_I2C

Change-Id: I5d292d70e0f04a718086f870c788237b873ae455
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
6 years agoi2c: s3c2410: change sequence for i2c_message_start
Hyunki Koo [Tue, 4 Mar 2014 14:13:18 +0000 (23:13 +0900)]
i2c: s3c2410: change sequence for i2c_message_start

Change-Id: Id00a637ffad58c6033231d67fed818ba27019769
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
6 years agoi2c: s3c2410: change code for s3c24xx_i2c_enable_ack
Hyunki Koo [Wed, 5 Mar 2014 06:28:45 +0000 (15:28 +0900)]
i2c: s3c2410: change code for s3c24xx_i2c_enable_ack

IICCON_BUS_RELEASE bit must be masked when IICCON_ACKEN is set
for fimc i2c

Change-Id: Ic80e4978560bf0aebefdf80ecc31420231d936ea
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
6 years agoi2c: s3c2410: Change CONFIG_CPU_IDLE to CONFIG_EXYNOS_I2C_STOP_DURING_DSTOP
Eunki Kim [Thu, 23 Jan 2014 08:32:43 +0000 (17:32 +0900)]
i2c: s3c2410: Change CONFIG_CPU_IDLE to CONFIG_EXYNOS_I2C_STOP_DURING_DSTOP

Change-Id: I98197b8b954303de59cc113fce067386e9d05fcb
Signed-off-by: Eunki Kim <eunki_kim@samsung.com>
6 years agoi2c: s3c2410: hw init after LPA
Eunki Kim [Wed, 22 Jan 2014 03:22:56 +0000 (12:22 +0900)]
i2c: s3c2410: hw init after LPA

Signed-off-by: Eunki Kim <eunki_kim@samsung.com>
Conflicts:

drivers/i2c/busses/i2c-s3c2410.c

Change-Id: Ie61c476af4a56e94611051434453bcfc34df89be

6 years agoi2c: s3c2410: Fix initial sequnce for fimc-is's I2C
Dongsu Ha [Fri, 10 Jan 2014 04:29:38 +0000 (13:29 +0900)]
i2c: s3c2410: Fix initial sequnce for fimc-is's I2C

Change-Id: I14068750fff931b09ab0a31d6cdb041d7b4e915f
Signed-off-by: Dongsu Ha <dsfine.ha@samsung.com>
6 years agoi2c: s3c2410: Fix pm_runtime to support fimc-is's I2C
Eunki Kim [Thu, 2 Jan 2014 05:20:54 +0000 (14:20 +0900)]
i2c: s3c2410: Fix pm_runtime to support fimc-is's I2C

Signed-off-by: Eunki Kim <eunki_kim@samsung.com>
Conflicts:

drivers/i2c/busses/i2c-s3c2410.c

Change-Id: I7cee624014e46e0b43b95f306b8ca39975be2a6b

6 years agoi2c: s3c2410: remove S3C24XX I2C frequency scaling
Hyeonkook Kim [Wed, 11 Dec 2013 04:26:43 +0000 (13:26 +0900)]
i2c: s3c2410: remove S3C24XX I2C frequency scaling

Thia patch removes CPU frequency scaling to the S3C24XX I2C driver.
The S3C24XX I2C driver doesn't depends on CPU frequency scaling.

Signed-off-by: Hyeonkook Kim <hk619.kim@samsung.com>
Conflicts:

drivers/i2c/busses/i2c-s3c2410.c

Change-Id: If9fa067fd54ea3da2ec459f99db24002c8b7b3d2

6 years agoi2c: s3c2410: Adds support fimc-is-i2c
Hyeonkook Kim [Thu, 14 Nov 2013 10:25:19 +0000 (19:25 +0900)]
i2c: s3c2410: Adds support fimc-is-i2c

This patch supports fimc-is-i2c using device tree
or platform device variant.
If the QUIRK_FIMC_I2C is added, i2c enables bus hold interrupt
and adds clock rate at s3c24xx_i2c_xfer() for fimc-is-i2c.

Signed-off-by: Hyeonkook Kim <hk619.kim@samsung.com>
Conflicts:

drivers/i2c/busses/i2c-s3c2410.c

Change-Id: I8106ba452385c22e5fe2100ae5574b41f9b25769

6 years agoi2c: s3c2410: change clock to open gate clock
Hyunki Koo [Thu, 24 Oct 2013 09:38:52 +0000 (18:38 +0900)]
i2c: s3c2410: change clock to open gate clock

Clock for i2c device is changed to open gate clock.
but there is no clockrate information in gate_i2c clock.
so rate_2c clock is added to get clock rate

Change-Id: I4d6668fb8d4e6696865c39c6e84c44d0bc6836f5
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
6 years ago[COMMON] i2c: s3c2410: Migration from 4.4 based kernel
Youngmin Nam [Wed, 12 Apr 2017 16:14:03 +0000 (01:14 +0900)]
[COMMON] i2c: s3c2410: Migration from 4.4 based kernel

Change-Id: I4fec1947f1ebe6352f449078321137e00c1ff4c9
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoRevert "i2c: s3c2410: fix oops in suspend callback for non-dt platforms"
Youngmin Nam [Fri, 29 Apr 2016 05:59:37 +0000 (14:59 +0900)]
Revert "i2c: s3c2410: fix oops in suspend callback for non-dt platforms"

This reverts commit 8d487a43c36b54a029d74ad3b0a6a9d1253e728a.

Change-Id: I82de39f5d2331bcbf9b9d9dafca01eb12be8c923

6 years agoRevert "i2c: s3c2410: Handle i2c sys_cfg register in i2c driver"
Youngmin Nam [Fri, 29 Apr 2016 05:19:37 +0000 (14:19 +0900)]
Revert "i2c: s3c2410: Handle i2c sys_cfg register in i2c driver"

This reverts commit a7750c3ef0122383901ae48396188aa4b861d32b.

Change-Id: I4e6ace8e8a7de48fb5fdcef9b900d50ad5588831

6 years ago[9610] arm64: dts: modify clk name to ipclk and gate_clk
myung-su.cha [Thu, 10 May 2018 04:12:50 +0000 (13:12 +0900)]
[9610] arm64: dts: modify clk name to ipclk and gate_clk

Change-Id: If25739f604597e853c5b6c3f27485c32db515e55
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[9610] arm64: configs: erd9610: enable i2c options
myung-su.cha [Wed, 9 May 2018 12:54:16 +0000 (21:54 +0900)]
[9610] arm64: configs: erd9610: enable i2c options

Change-Id: Ic992792ef10f808db0aaa08d354ffd22b58fec56
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[9610] arm64: pinctrl: dtsi: add usi pinctrl node
myung-su.cha [Wed, 9 May 2018 12:50:19 +0000 (21:50 +0900)]
[9610] arm64: pinctrl: dtsi: add usi pinctrl node

Change-Id: I36b8b7b44fa152a1ecd287864fddbbb2eeb0f204
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[9610] arm64: erd9610: dts: add usi node
myung-su.cha [Wed, 9 May 2018 12:48:12 +0000 (21:48 +0900)]
[9610] arm64: erd9610: dts: add usi node

Change-Id: I9ed378adc2185e149388dc45350de6b4882f32ac
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[9610] arm64: dts: add USI dt node
myung-su.cha [Wed, 9 May 2018 12:47:15 +0000 (21:47 +0900)]
[9610] arm64: dts: add USI dt node

Change-Id: Ifaefd0383227abf44bd09fcca32f9b0b74ad845b
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[COMMON] spi: s3c64xx: fix of_node name correctly
myung-su.cha [Tue, 27 Mar 2018 10:14:25 +0000 (19:14 +0900)]
[COMMON] spi: s3c64xx: fix of_node name correctly

Change-Id: I179abd43e731fb25f2e4806afed18fe93fc61a00
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[COMMON] spi: s3c64xx: modify clk name to ipclk and gate clk
myung-su.cha [Wed, 21 Mar 2018 09:04:04 +0000 (18:04 +0900)]
[COMMON] spi: s3c64xx: modify clk name to ipclk and gate clk

Change-Id: I45b5388b905403028b8a2733d61b3359143e5e8f
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[COMMON] spi: s3c64xx: Add return value check after clk_set_rate
Kyungwoo Kang [Thu, 7 Sep 2017 09:43:12 +0000 (18:43 +0900)]
[COMMON] spi: s3c64xx: Add return value check after clk_set_rate

CID: 197154

After clk_set_rate we need to check the return value is fine.

Change-Id: I66526a3d180626e9c8bedb7094f325e0044e5975
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] spi: s3c64xx: Fix Code sequece by architectual guide.
Kyungwoo_Kang_System [Thu, 7 Sep 2017 09:06:42 +0000 (18:06 +0900)]
[COMMON] spi: s3c64xx: Fix Code sequece by architectual guide.

The guide of SPI PACKET CNT SFR setting is like below.
[Disable the channel] -> [Change PACKET CNT SFR] -> [Enable the channel]

Previously our SPI driver code sequece is differ from architectual guide.
To prevent SPI malfunction, we change the code sequence.

Change-Id: I8c105b97f1e36912064ac1c9cfb8f5c43f079927
Signed-off-by: Kyungwoo_Kang_System <kwoo.kang@luwak.(none)>
6 years agoRevert "[COMMON] spi: s3c64xx: Add Rx channel disalbe after fifo full"
Kyungwoo Kang [Thu, 7 Sep 2017 09:16:21 +0000 (18:16 +0900)]
Revert "[COMMON] spi: s3c64xx: Add Rx channel disalbe after fifo full"

This reverts commit 38b69556a309eb818506a5642309c3e9e44b8d95.

Change-Id: I87b8a9cefcf23c7b6828302b296b8d25689695d9
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] spi: s3c64xx: Add Rx channel disalbe after fifo full
Sanghoon Lee [Tue, 5 Sep 2017 13:55:55 +0000 (22:55 +0900)]
[COMMON] spi: s3c64xx: Add Rx channel disalbe after fifo full

This patch is for Camera SPI Channel. There sould be Rx channel
off sequence between Rx Fifo Full and Read data from Rx FIFO.

Change-Id: I67acce6fd1ad283dc48330644a07221d2108d0cb
Signed-off-by: Sanghoon Lee <shoon114.lee@samsung.com>
6 years agospi: s3c64xx: print DMA register dump on timeout error
Jung-Ick Guack [Thu, 14 Jul 2016 04:39:21 +0000 (13:39 +0900)]
spi: s3c64xx: print DMA register dump on timeout error

Change-Id: Iccb09fa443ea604d757ccc96b1a602964bbea9e9
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
6 years ago[COMMON] spi: s3c64xx: Encreased max port number of spi
Kyungwoo Kang [Mon, 17 Jul 2017 23:57:06 +0000 (08:57 +0900)]
[COMMON] spi: s3c64xx: Encreased max port number of spi

SPI max port number has been increased

Change-Id: I6fa9b0eba512d521126ad38f86bdb4a052d877eb
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] spi: s3c64xx: Fix div factor for USI v2.
Kyungwoo Kang [Fri, 7 Apr 2017 08:45:55 +0000 (17:45 +0900)]
[COMMON] spi: s3c64xx: Fix div factor for USI v2.

This patch fixes SPI div factor from 2 to 4 due to HW change on USIv2
USIv2 has fixed 4 time divider so that SW needs to change requiring
4 time bigger source clock

Change-Id: I6387556ad7f493d5d0e4a699979fb868704fddd8
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] spi: s3c64xx: set USI_RESET before channel setting.
Youngmin Nam [Mon, 23 Jan 2017 02:05:37 +0000 (11:05 +0900)]
[COMMON] spi: s3c64xx: set USI_RESET before channel setting.

Change-Id: Ib7b169daf20d2e1355135f329609abac68bf97ed
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] spi: s3c64xx: add SPI self loopback feature
Youngmin Nam [Mon, 23 Jan 2017 06:05:22 +0000 (15:05 +0900)]
[COMMON] spi: s3c64xx: add SPI self loopback feature

Change-Id: I4558c14f298a1ccf85d98fa3fe86be7726eafef7
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] spi: s3c64xx: set DMA_BIT_MASK from 32 to 36
Youngmin Nam [Thu, 12 Nov 2015 02:41:53 +0000 (11:41 +0900)]
[COMMON] spi: s3c64xx: set DMA_BIT_MASK from 32 to 36

This patch changes DMA_BIT_MASK to 36 to disable ZONE_DMA

Change-Id: Idf2b475b2acc4d7cd2755c38b720435712fbffa9
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] spi: s3c64xx: call runtime pm callback directly in suspend / resume function
Youngmin Nam [Tue, 15 Nov 2016 01:31:44 +0000 (10:31 +0900)]
[COMMON] spi: s3c64xx: call runtime pm callback directly in suspend / resume function

If there is transfer request in system suspend stage, the runtime suspend callback
will not be called after transfer completion because the runtime suspend callback of
pm_runtime_put_autosuspend() is queued into workqueue as freezable.
After that, without calling runtime suspend callback before system suspend, it can cause
lock up by central sequencer stuck because clock request is high.
To fix this issue, runtime pm callback should be called directly in suspend / resume
function if runtime pm status is not "suspended".

Change-Id: Iac05b22e50f29bf24fc04eb06719105e65e48ec3
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] spi: s3c64xx: prevent SPI port probe of exceeding max channel number
Youngmin Nam [Tue, 26 Jul 2016 10:32:53 +0000 (19:32 +0900)]
[COMMON] spi: s3c64xx: prevent SPI port probe of exceeding max channel number

This patch prevents SPI port probing when the SPI port number exceeds
SPI max channel numbers.

Change-Id: I5e4c1c60c2ea3db645118d946271a83e04548ebc
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] spi: s3c64xx: increase SPI max channel number
Youngmin Nam [Mon, 25 Jul 2016 14:59:48 +0000 (23:59 +0900)]
[COMMON] spi: s3c64xx: increase SPI max channel number

Change-Id: Ifa5db13315ed22a0f9825e0ff48f6b78bd9c0193
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] spi: s3c64xx: optimize SPI controller reigster dump routine
Youngmin Nam [Thu, 26 May 2016 05:28:20 +0000 (14:28 +0900)]
[COMMON] spi: s3c64xx: optimize SPI controller reigster dump routine

This patch decrease the number of calls of dev_err in register dump routine.

Change-Id: Ib81c94163506de3338a5f299edadc8acac113036
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agospi: s3c64xx: Change CONFIG_PM_RUNTIME to CONFIG_PM
Youngmin Nam [Fri, 13 May 2016 06:43:52 +0000 (15:43 +0900)]
spi: s3c64xx: Change CONFIG_PM_RUNTIME to CONFIG_PM

This patch chagnes CONFIG_PM_RUNTIME to CONFIG_PM in exynos SPI driver.
This patch shoud be applied to sync with below commit.

commit 464ed18ebdb6236fcff59d2a35d4d2e28668435a
PM: Eliminate CONFIG_PM_RUNTIME
Having switched over all of the users of CONFIG_PM_RUNTIME to use
CONFIG_PM directly, turn the latter into a user-selectable option
and drop the former entirely from the tree.

Change-Id: Idaf5261c150284009c8d58737c99cb16f0a61b85
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agospi: s3c64xx: Get fifosize via device tree
Youngmin Nam [Tue, 16 Jun 2015 15:08:08 +0000 (00:08 +0900)]
spi: s3c64xx: Get fifosize via device tree

SPI code on some SoCs only differ in the fifosize of each
SPI channel. It is useless to duplicate the drv_data structure
or create a compatible name for such a change.

We can get fifosize via the device tee nodes.

Change-Id: I6f064472b481c81d2328718ec4e8f04ea7676143
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agospi: s3c64xx: Change the header of exynos pm and powermode
Youngmin Nam [Thu, 12 May 2016 05:09:49 +0000 (14:09 +0900)]
spi: s3c64xx: Change the header of exynos pm and powermode

Change-Id: I069052e7da57372f4e8db5dbbe8a21ce1974bd17
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agospi: s3c64xx: remove unused code
Youngmin Nam [Wed, 12 Apr 2017 13:54:32 +0000 (22:54 +0900)]
spi: s3c64xx: remove unused code

Change-Id: I728e0eb38f907bbf50823aa9b79ff9385adaed9e
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agospi: s3c64xx: Remove unnecessary codes related DMA
Kisang Lee [Thu, 11 Jun 2015 07:38:17 +0000 (16:38 +0900)]
spi: s3c64xx: Remove unnecessary codes related DMA

Change-Id: I8b63791e31c11defd3242643d14a9b2fe372eaaa
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
6 years agospi: s3c64xx: Add LPD powermode and update idle status register
Youngmin Nam [Fri, 24 Apr 2015 08:24:51 +0000 (17:24 +0900)]
spi: s3c64xx: Add LPD powermode and update idle status register

This patch adds LPD powermode and updates idle status register
when clock/power of IP is en/disabled to check LPD condition.

Change-Id: I6aeb2ede54181bddbfd92bfac1f6d493a95ee54d
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agospi: s3c64xx: Add debug features to check configurations
Kisang Lee [Thu, 9 Apr 2015 12:00:29 +0000 (21:00 +0900)]
spi: s3c64xx: Add debug features to check configurations

This patch enables debug features through the sysfs.

Change-Id: I6fe0a34faf8b279342dd681bf580ef9654441018
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
6 years agospi: s3c64xx: Migration from 3.18 based kernel
Youngmin Nam [Wed, 12 Apr 2017 13:34:50 +0000 (22:34 +0900)]
spi: s3c64xx: Migration from 3.18 based kernel

Change-Id: Ibb049f0ca0f8d3ebe526e912b610490c1ed2a246
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years agoANDROID: serial_core: Add wake_peer uart operation
San Mehat [Thu, 30 Jul 2009 03:21:28 +0000 (20:21 -0700)]
ANDROID: serial_core: Add wake_peer uart operation

Add wake_peer which is called before starting UART TX. The idea here
is to provide a mechanism where we can wakeup our peer before sending
data.

Change-Id: I42e0779b635f64ca99184b45d5b028de80197491
Signed-off-by: San Mehat <san@google.com>
6 years ago[COMMON] i2c: exynos5: fix Tx sequence of i2c_xfer_msg
myung-su.cha [Tue, 3 Apr 2018 05:11:22 +0000 (14:11 +0900)]
[COMMON] i2c: exynos5: fix Tx sequence of i2c_xfer_msg

Interrupt routine and Polling routine of Tx are carried out twice
unnecessarilly. Therefore, This patch combines it one Interrupt and
Polling routine.

Change-Id: If8443009a50c94c5a6d0b34f9ffa921d1d48b680
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add Standard mode for HSI2C
Kyungwoo Kang [Wed, 28 Mar 2018 01:03:14 +0000 (10:03 +0900)]
[COMMON] i2c: exynos5: Add Standard mode for HSI2C

Now we support standard mode for HSI2C like below.
[Standard - Fast - Fast plus - High Speed]

Change-Id: I4c804ed85086b848695a7d21552f7c7cbb6771d9
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: modify clk name to ipclk and gate
myung-su.cha [Wed, 21 Mar 2018 09:01:39 +0000 (18:01 +0900)]
[COMMON] i2c: exynos5: modify clk name to ipclk and gate

Change-Id: I44f0e61f5f5d6dd34804705851c61a68fba5ed6d
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
6 years ago[COMMON] hsi2c: exynos5: Fix naming of Fast plus mode
Kyungwoo Kang [Tue, 20 Mar 2018 04:59:21 +0000 (13:59 +0900)]
[COMMON] hsi2c: exynos5: Fix naming of Fast plus mode

Previously Fast plus mode naming has been declared standard mode.

Change-Id: I6b67ac08821485a55b3ee354ea9ae5d54e3c6e5d
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: fix build worning
Hyunki Koo [Wed, 17 Jan 2018 05:54:23 +0000 (14:54 +0900)]
[COMMON] i2c: exynos5: fix build worning

Change-Id: Icaf0b8f20d9c0d137f089610c61bfa1a5235695a
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add configs for SICD
Kyungwoo Kang [Fri, 12 Jan 2018 08:55:46 +0000 (17:55 +0900)]
[COMMON] i2c: exynos5: Add configs for SICD

Change-Id: Ic86404e77231e634d79c782bbb08167191a0e17d
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add checking Transfer done at ISR
Kyungwoo Kang [Tue, 9 Jan 2018 07:24:06 +0000 (16:24 +0900)]
[COMMON] i2c: exynos5: Add checking Transfer done at ISR

Previously when NACK occurred we just retry the protocol.
But it is possible to TR_DONE interrupt occur at the process
of NACK ISR. To prevent TR_DONE interrupt clear, we consider
TR_DONE at NACK ISR.

Change-Id: I3eb57019de66849e75c5f53dbfeb4d988c81bdc0
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add standard mode timing calc
Kyungwoo Kang [Wed, 6 Dec 2017 23:26:11 +0000 (08:26 +0900)]
[COMMON] i2c: exynos5: Add standard mode timing calc

Previously exynos soc supports only FS/HS mode.
From USI version2, we support Standard mode as well.

Change-Id: Id6c4d3daff2d8b0d1f8a899eee305c163b0338c0
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Fix prevent defect
Kyungwoo Kang [Thu, 23 Nov 2017 09:00:44 +0000 (18:00 +0900)]
[COMMON] i2c: exynos5: Fix prevent defect

CID 201957 prevent solve patch.

Change-Id: I5f16c248540f561d4d9772fd84c3e8fc04e097e5
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add NACK service routine & property
Kyungwoo Kang [Mon, 20 Nov 2017 01:48:23 +0000 (10:48 +0900)]
[COMMON] i2c: exynos5: Add NACK service routine & property

Change-Id: I299b23346b51266719fb908390e01989dcf2fe92
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years agoRevert "[COMMON] i2c: exynos5: Add No Dev interrupt service routine"
Kyungwoo Kang [Mon, 20 Nov 2017 01:45:28 +0000 (10:45 +0900)]
Revert "[COMMON] i2c: exynos5: Add No Dev interrupt service routine"

This reverts commit 95ec305230be705e68213fc7e0b98e5aeb63dce5.

Change-Id: Id9122a551e480e85da9121415700271bea9c16bd
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add No Dev interrupt service routine
Kyungwoo Kang [Wed, 8 Nov 2017 10:10:09 +0000 (19:10 +0900)]
[COMMON] i2c: exynos5: Add No Dev interrupt service routine

For some slave devices No ACK needs to be handled.
Previously the system considered NACK as an error situation
and stops the I2C request.
Now we let the i2c transaction go when NACK interrupt occurs
until the timeout value is expired.

Change-Id: Iab42792fb589782d52e30df5690934a7afefdb4a
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Fix Enable IRQ sequence
Kyungwoo Kang [Fri, 20 Oct 2017 05:27:07 +0000 (14:27 +0900)]
[COMMON] i2c: exynos5: Fix Enable IRQ sequence

By architectual guide, IRQ_EN SFR must be set before Master runs.
Previously this sequeuce has been opposite.

Change-Id: I04997171ae5c28a4ca0e6aacd317ddd5fed61dd2
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Fix trigger level for HSI2C
Kyungwoo Kang [Thu, 28 Sep 2017 06:26:23 +0000 (15:26 +0900)]
[COMMON] i2c: exynos5: Fix trigger level for HSI2C

This patch is for fixing trigger level as msg length
by architectual guide.

Change-Id: If66526e038c0dfa3deb4da7920c76976880325ea
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[9810] i2c: exynos5: Binding IRQ for HSI2C latency.
Kyungwoo Kang [Fri, 29 Sep 2017 06:38:13 +0000 (15:38 +0900)]
[9810] i2c: exynos5: Binding IRQ for HSI2C latency.

Interrupt and scheduling latency casues the slave timeout failure
during I2C protocol.
This patch binds the I2C IRQ to specified CPUs in order to
reduce these latency

Change-Id: I3fc6459577bac64539d79f5305dd6b3bc3f451fc
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Fix prevent defect
Kyungwoo Kang [Thu, 7 Sep 2017 09:56:03 +0000 (18:56 +0900)]
[COMMON] i2c: exynos5: Fix prevent defect

CID: 197277

Fix prevent defcet, unsigned comparrison which return
value is never true.

Change-Id: If3890084cc46b01b5fd6dbb467b760113f393b3c
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add input clock setting scheme
Kyungwoo Kang [Thu, 15 Jun 2017 05:58:22 +0000 (14:58 +0900)]
[COMMON] i2c: exynos5: Add input clock setting scheme

Since USI version 2 each I2C channel sets its input clock.

Change-Id: I933038bd0373e2c18d915e67f85aad8a7904e761
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Add MASTER INIT STATUS check
Kyungwoo Kang [Wed, 10 May 2017 05:46:27 +0000 (14:46 +0900)]
[COMMON] i2c: exynos5: Add MASTER INIT STATUS check

Master will know a transaction done by watching trans status SFR.
From USIv2 this status SFR has been changed, INIT status(0x1) represents
previous IDLE status(0x0)

Change-Id: I54e815a6833962e359c9adcb2865e82e3ad4338e
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Change debugging log.
Kyungwoo Kang [Fri, 12 May 2017 03:51:07 +0000 (12:51 +0900)]
[COMMON] i2c: exynos5: Change debugging log.

USIv2 HSI2C has different SFR set. So we need to change
dump SFR for USIv2.

Change-Id: I397e607da668f92068a507e6dfc9b215ac37adc2
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: Fix debug print info
Kyungwoo Kang [Sat, 6 May 2017 03:13:37 +0000 (12:13 +0900)]
[COMMON] i2c: exynos5: Fix debug print info

Add Dev->i2c node to see which node debug information is printed

Change-Id: Ibd2ff3f707175732fa4c1b28a576afe9fc5c4209
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: I2C SFR changes
Kyungwoo Kang [Thu, 4 May 2017 04:51:41 +0000 (13:51 +0900)]
[COMMON] i2c: exynos5: I2C SFR changes

Trans status register has been changed by USIv2.

Change-Id: Ib5e50d59465eff40ba33fa19b7c42b84675f4668
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: I2C transfer sequence change for Clock changes
Kyungwoo Kang [Thu, 4 May 2017 04:50:21 +0000 (13:50 +0900)]
[COMMON] i2c: exynos5: I2C transfer sequence change for Clock changes

Transfer sequence has been changed for input clock. We no longer
wait until Master status IDLE between transfer and another transfer.
If we put SFR access or print log for debugging, it will increase
transfer latency.

Change-Id: I512adcbb7394e9566c535020e7aea29d23838188
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: I2C Timing cal code changes
Kyungwoo Kang [Thu, 4 May 2017 04:45:01 +0000 (13:45 +0900)]
[COMMON] i2c: exynos5: I2C Timing cal code changes

USIv2 has benn changed timing parameter and IPCLk input.
This patch includes timing calculate code.

Change-Id: I4d3d06a867b56fc50fab73e5064547c0ab9b9a19
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: set USI_RESET before channel setting.
Youngmin Nam [Mon, 20 Mar 2017 08:05:22 +0000 (17:05 +0900)]
[COMMON] i2c: exynos5: set USI_RESET before channel setting.

Change-Id: I71f2cf29f4a3768c7d20416ee9782970a81557cf
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
6 years ago[COMMON] i2c: exynos5: add runtime pm callback status flag
Youngmin Nam [Mon, 6 Feb 2017 03:27:13 +0000 (12:27 +0900)]
[COMMON] i2c: exynos5: add runtime pm callback status flag

Adds runtime pm suspend / resume callback status flag to check
whether runtime pm callback was called or not.

Change-Id: I603d33f730b8b778fbfeb17e827f602416f66524
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: exynos5: modify HSI2C polling transfer routine
Youngmin Nam [Thu, 18 Aug 2016 08:02:53 +0000 (17:02 +0900)]
[COMMON] i2c: exynos5: modify HSI2C polling transfer routine

Change-Id: I123d6728144e1ae8f2baefe0f9535c3974375b23
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: exynos5: call runtime pm callback directly in suspend / resume function
Youngmin Nam [Mon, 14 Nov 2016 11:36:53 +0000 (20:36 +0900)]
[COMMON] i2c: exynos5: call runtime pm callback directly in suspend / resume function

If there is transfer request in system suspend stage, the runtime suspend callback
will not be called after transfer completion because the runtime suspend callback of
pm_runtime_put_autosuspend() is queued into workqueue as freezable.
After that, without calling runtime suspend callback before system suspend, it can cause
lock up by central sequencer stuck because clock request is high.
To fix this issue, runtime pm callback should be called directly in suspend / resume
function if runtime pm status is not "suspended".

Change-Id: I5c5751debb577dfce2a838212d45c72b2c2f4a05
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: exynos5: set HSI2C s/w reset without clear
Youngmin Nam [Mon, 5 Sep 2016 12:53:37 +0000 (21:53 +0900)]
[COMMON] i2c: exynos5: set HSI2C s/w reset without clear

This patch sets HSI2C s/w reset before suspend without clear to
prevent central sequence stuck by HSI2C master clock reuqest.

Change-Id: I0cc38923758db76a73d96a331af79dc99d6b863f
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: exynos5: reset i2c master before suspend
Youngmin Nam [Fri, 29 Jul 2016 05:16:45 +0000 (14:16 +0900)]
[COMMON] i2c: exynos5: reset i2c master before suspend

This patch resets i2c master before suspend to prevent central secquence
stuck. If master state is in arbitration lose, I2C master requests
clock for operation. So we need to reset i2c master to recover from
arbitration lose state.

Change-Id: I5f5996b38148868b1fac26d2b81284ae7a9ad1f3
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: exynos5: removed clk_unprepare during suspend
Jung-Ick Guack [Fri, 1 Jul 2016 07:40:50 +0000 (16:40 +0900)]
[COMMON] i2c: exynos5: removed clk_unprepare during suspend

Fixed warning case during suspend.
There is the case that is calling clk_unprepare
even not called clk_disable during suspend_noirq.

flow of warning case:
exynos5_i2c_runtime_resume    (clk_enable)
-> exynos5_i2c_suspend_noirq  (clk_unprepare)
-> exynos5_i2c_runtime_suspend(clk_disable)

Change-Id: I482c924a2440caa5407e4b6682b1f4fc10648dc5
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
6 years ago[COMMON] i2c: exynos5: optimize HSI2C reigster dump routine
Youngmin Nam [Thu, 26 May 2016 04:51:06 +0000 (13:51 +0900)]
[COMMON] i2c: exynos5: optimize HSI2C reigster dump routine

This patch decrease the number of calls of dev_err in register dump routine.

Change-Id: I83e42dd14060fc110c8ede05197d266498cde42f
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
6 years ago[COMMON] i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared
Youngmin Nam [Tue, 14 Jun 2016 11:48:09 +0000 (20:48 +0900)]
[COMMON] i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared

This patch came from commit "3b566a5c38b7311a545ac536a3b43944153918d2"

---------------------------------------------------------------------
commit 10ff4c5239a137abfc896ec73ef3d15a0f86a16a upstream.

The exynos5 I2C controller driver always prepares and enables a clock
before using it and then disables unprepares it when the clock is not
used anymore.

But this can cause a possible ABBA deadlock in some scenarios since a
driver that uses regmap to access its I2C registers, will first grab
the regmap lock and then the I2C xfer function will grab the prepare
lock when preparing the I2C clock. But since the clock driver also
uses regmap for I2C accesses, preparing a clock will first grab the
prepare lock and then the regmap lock when using the regmap API.

An example of this happens on the Exynos5422 Odroid XU4 board where a
s2mps11 PMIC is used and both the s2mps11 regulators and clk drivers
share the same I2C regmap.

The possible deadlock is reported by the kernel lockdep:

   Possible unsafe locking scenario:

           CPU0                    CPU1
           ----                    ----
   lock(sec_core:428:(regmap)->lock);
                                   lock(prepare_lock);
                                   lock(sec_core:428:(regmap)->lock);
   lock(prepare_lock);

   *** DEADLOCK ***

Fix it by leaving the code prepared on probe and use {en,dis}able in
the I2C transfer function.

This patch is similar to commit 34e81ad5f0b6 ("i2c: s3c2410: fix ABBA
deadlock by keeping clock prepared") that fixes the same bug in other
driver for an I2C controller found in Samsung SoCs.
--------------------------------------------------------------------

This patch is similar to commit "3b566a5c38b7311a545ac536a3b43944153918d2"
to apply current exynos5 hsi2c driver.

Change-Id: Iefc7a31e2c2db1e3f539654aa609aa6a8ed4cbfe
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>