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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Youngmin Nam [Thu, 28 Apr 2016 07:16:17 +0000 (16:16 +0900)]
i2c: exynos5: Change CONFIG_PM_RUNTIME to CONFIG_PM
This patch chagnes CONFIG_PM_RUNTIME to CONFIG_PM in exynos HSI2C 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: If7421335af17e97f4c55563604d0b2820a5020ee
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Tue, 5 Jan 2016 06:18:28 +0000 (15:18 +0900)]
i2c: exynos5: add conditional reset of hsi2c master before transfer
This patch resets hsi2c master before transfer if related property was set.
HSI2C master can goes into master arbitration lost state if there is the
fluctuation on SCL/SDA line before starting transfer.
To getting out of this state, mater should be reset.
Change-Id: I2487152abff708f61182bbca866f51a421a0c4c9
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Wed, 23 Dec 2015 09:26:12 +0000 (18:26 +0900)]
i2c: exynos5: separate driver data structure to header file
Change-Id: I4a7d24acff0ef7b3439a75691537c844392146e4
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Sat, 4 Jul 2015 07:33:38 +0000 (16:33 +0900)]
i2c: exynos5: Change HSI2C timing parameter setting routine
This patch modifies HSI2C timing parameter setting routine following
H/W guide.
Change-Id: I10aa37c76dab1237a99ded8a7e8258c98f8a0c58
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Thu, 2 Jul 2015 11:36:37 +0000 (20:36 +0900)]
i2c: exynos5: Set sda line direction to gpio input for recovery
Change-Id: Ibada55d39ff876840ee22b5e95d781d59180c346
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Thu, 6 Apr 2017 06:02:25 +0000 (15:02 +0900)]
i2c: exynos5: Migration from 3.18 based kernel
Change-Id: Ibfe5c46e2c7f383db94f973298e0c507140596f9
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Kyungwoo Kang [Tue, 27 Mar 2018 21:43:09 +0000 (06:43 +0900)]
[COMMON] serial: samsung: Fix UART driver SW sequence
This patch fixes two potential sequential sw hole.
a. flush fifo after channel enable
b. change div setting after enable AFC
Change-Id: I559baba34fb4fd77fb26ddb7d9d8da3762cf5e86
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
myung-su.cha [Wed, 21 Mar 2018 09:07:04 +0000 (18:07 +0900)]
[COMMON] serial: samsung: modify clk name to ipclk and gate clk
Change-Id: I2d193cf9870b7f9af8128a2a509bbb23f923d6a3
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
myung-su.cha [Wed, 21 Mar 2018 08:54:47 +0000 (17:54 +0900)]
[COMMON] serial: samsung: modify UART UDIVSLOT calculation method
Set UDIVSLOT to the lowest error rate.
Change-Id: I82ae10969a7048730d1d380cf6867c1d1792563a
Signed-off-by: myung-su.cha <myung-su.cha@samsung.com>
Park Bumgyu [Fri, 23 Feb 2018 04:02:27 +0000 (13:02 +0900)]
serial: samsung: wait serial FIFO before entering SICD
Change-Id: I9580f8897592dca908e95780b39853f87b34d0f1
Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
Kyungwoo Kang [Wed, 3 Jan 2018 03:50:15 +0000 (12:50 +0900)]
[COMMON] serial: samsung: Add pinctrl fucntion.
For some devices like Bluetooth, RTS line should be protected
while suspending or SICD in and out in case of unexpected data
flow.
Change-Id: I42fb8c3009c4642b0f5fb74e18e8a6151e5b3b3f
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Kyungwoo Kang [Tue, 11 Jul 2017 06:31:55 +0000 (15:31 +0900)]
[COMMON] serial: samsung: Add suspend clock stop fucntion.
This patch is for USI_v2 UART port.
When the system goes into suspend mode, CLKSTOP_ON register
must be set by 1 not to get disturbed by any signal which
is not supposed to be.
Change-Id: Ia7cceaf4c4f04c7c039819cf80d08cdae6d5686b
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Kyungwoo Kang [Thu, 13 Apr 2017 08:45:18 +0000 (17:45 +0900)]
[COMMON] uart: samsung: Add UART code for USI v2.
This code includes ULCON, UCON differences from USIv1 and v2
Change-Id: I86aa7541f8af5f1d8908dd33bb0ece38f9bda9c2
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Youngmin Nam [Tue, 17 Jan 2017 02:54:05 +0000 (11:54 +0900)]
[COMMON] serial: samsung: set USI_RESET before channel setting
Change-Id: I222a1939d82041202ec999d14ef797bdf08b3776
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Mon, 2 Jan 2017 09:12:14 +0000 (18:12 +0900)]
[COMMON] serial: samsung: set CLKREQ/STOP in according to USI_HWACG guide
Change-Id: I25454e7d518aa289a348a6cafac1207984aa4efa
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Robert Baldyga [Mon, 24 Nov 2014 06:56:24 +0000 (07:56 +0100)]
[COMMON] serial: samsung: use port->fifosize instead of hardcoded values
Hardcoded FIFO size can cause hardware performance limitation.
Using real size value provides better FIFO usage.
Change-Id: Ie7d99d6b3661db60f1ae039ddfbd7d80f3fdc8b1
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Youngmin Nam [Mon, 12 Dec 2016 01:24:50 +0000 (10:24 +0900)]
[COMMON] serial: samsung: change the routine for detecting consone UART port
Change-Id: I16e951bcf624d98f0117ac891e981682274d53f1
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Fri, 11 Nov 2016 08:22:55 +0000 (17:22 +0900)]
[COMMON] serial: samsung: add clock control routine in suspend
Change-Id: I85a472eca32c6447aee9b571fda83b18928266e0
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Mon, 17 Oct 2016 06:25:08 +0000 (15:25 +0900)]
[COMMON] serial: samsung: prevent UART port probe of exceeding max channel number
This patch prevents UART port probing when the UART port number exceeds
UART max channel numbers.
Change-Id: Ia4d0ee85fd240ec4e83107a3e67d66797e1733fd
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Jung-Ick Guack [Wed, 20 Jul 2016 06:56:37 +0000 (15:56 +0900)]
[COMMON] serial: samsung: changed trigger point of disabling UART Tx/Rx mode
Change-Id: Ib6aff5d160b011a3064e802a9670aa7dec5286a5
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
Youngmin Nam [Fri, 24 Jun 2016 11:38:15 +0000 (20:38 +0900)]
[COMMON] serial: samsung: Adds disabling UART UCON Tx / Rx mode bit for suspend
This patch adds routines for disabling UCON Tx, Rx mode bit for suspend state.
When HWACG(Hardware Auto Clock Gating) of UART is enabled,
The UCON Tx, Rx mode bit of UART register should be disabled to enter
system power mode.
Change-Id: I290c4f1baa5ac8e1a1e3a507709c7cd5d3df18ed
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Jung-Ick Guack [Tue, 7 Jun 2016 12:00:34 +0000 (21:00 +0900)]
[COMMON] serial: samsung: changed clk_get to devm_clk_get.
In kernel 4.4 clk_get has been changed to alloc memory.
Changed clk_get to devm_clk_get, removed clk_put.
Removed calling clk_get for same uart sclk.
Change-Id: I5778e7f581b155a82640d239cf10f27847409bf4
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
Jung-Ick Guack [Tue, 14 Jun 2016 09:12:53 +0000 (18:12 +0900)]
[COMMON] serial: samsung: Support in-band-wakeup
'in band wakeup' is for enabling wakeup UART_BT
during sleep. CTS or RXD could be wakeup source.
RTS should be Low during sleep.
Change-Id: Ifa683ebad4676ba00513c4a7b699850cdf4c2c50
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
Youngmin Nam [Fri, 18 Sep 2015 01:17:57 +0000 (10:17 +0900)]
serial: samsung: optimize UART RX interrupt handler
This patch optimizes UART RX interurpt handler by
reading UART SFR when necessary.
Change-Id: I45def0b0906b0d55a7c1314832d9fab593c87e71
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Tue, 1 Dec 2015 01:09:49 +0000 (10:09 +0900)]
serial: samsung: fix prevent defects in serial driver
This patch fixes prevent defects in serial drvier.
The "qos_timeout" value should be read as unsigned long type.
Change-Id: Ib335fcbd4580e034d97221827545b8072e5c13b8
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Fri, 11 Dec 2015 01:32:39 +0000 (10:32 +0900)]
serial: samsung: remove clock control in SICD notifer
This patch removes clock control in SICD notifier.
SICD notifier will be applied when the pm state of uart port is ON.
Change-Id: I993f5e982734a325a554e0e45dd4f5da20513abc
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Wed, 9 Dec 2015 04:04:56 +0000 (13:04 +0900)]
serial: samsung: Add SICD notifier call
This patch sets RTS as HIGH not to receive data from external device
when AP enters SICD. And sets RTS as LOW to receive data
when AP comes out SICD
Change-Id: Ie1260e635d15d9e60ed36ea12669411d5b0be20c
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Sat, 8 Aug 2015 03:42:45 +0000 (12:42 +0900)]
serial: samsung: remove serial_get/setsource function
This patch removes serial_get/setsource function that are not necessary.
On Exynos5 and Exynos7, the number of clk source of baudrate is 1.
That is, "num_clks" is always 1, we don't need to change clock source of
baudrate.
Change-Id: I0284788f0074d6d7ae7ecc43f7e6c4d8e27ed63e
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Fri, 7 Aug 2015 04:51:48 +0000 (13:51 +0900)]
serial: samsung: remove UART baudrate clock enable
This patch removes clock enable routine for baudrate.
On Exynos5 and Exynos7, uart baudrate clock will be either
sclk or divider of sclk which is parent clock of sclk.
So, we don't need to enable baudrate clock. Because
when we enable sclk, baudrate clock is also enabled.
Change-Id: I3316cac79559746f8a4c27c844bc793743fe5ee6
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Wed, 1 Jul 2015 05:13:52 +0000 (14:13 +0900)]
serial: samsung: Remove unnecessary UART clock en/disable
Change-Id: I305db3b9243f7868e625693aa43e20aade9b7f57
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Youngmin Nam [Wed, 5 Apr 2017 13:11:47 +0000 (22:11 +0900)]
serial: samsung: Migration from 3.18 based kernel
Change-Id: Id130435177b6c45e526a32d6e1ba715027c4e1da
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Jaehyoung Choi [Wed, 9 May 2018 11:23:45 +0000 (20:23 +0900)]
[COMMON] pinctrl: samsung: Disable DISPAUD init, suspend/resume
DISPAUD is initialized and suspend/resume independently.
Change-Id: If428ee1fd80c17eca40a38c1b3a861bdc275d6b1
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Jaehyoung Choi [Tue, 8 May 2018 05:41:58 +0000 (14:41 +0900)]
[COMMON] pinctrl: samsung: Fix 9610 pin bank struct
Change-Id: I21e54a3018482988ebd9c9c8c3f15e3ebc32cc2b
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Jaehyoung Choi [Sun, 14 Jan 2018 06:48:41 +0000 (15:48 +0900)]
[COMMON] rtc: rtc-s3c: Fix build error for kernel 4.14
Change-Id: I0853f1b233346f3c6f6a11c0888c7acb70fa7741
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Choi Jaehyoung [Mon, 7 Aug 2017 05:27:10 +0000 (14:27 +0900)]
[COMMON] rtc: rtc-s3c: Initialize BCD register
1) Reset values of BCD registers are undefined.
Therefore, there is no guarantee
that these registers are initialized to BCD values.
Initialize BCD register in RTC probe function
2) BCD year register uses 12bit.
Change-Id: I7ce7fb59db96b5347ff008d5806036b10a8b844f
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Choi Jaehyoung [Mon, 24 Apr 2017 08:35:09 +0000 (17:35 +0900)]
[9810] rtc-s3c: Add tick count register.
In exynos9810, there is one more tick count register.
TICK register is divided into TICK_0 and TICK_1 to distinguish the new Tick count register.
Change-Id: I2d5ebb72305fb164fc21054a84301ebdc2a41a86
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Kang KyungWoo [Mon, 13 Jun 2016 12:07:13 +0000 (21:07 +0900)]
[COMMON] rtc: samsung: Add disabling clock control with AP rtc
This patch is for disabling clock control for AP RTC.
At exynos8 series, we no longer need to control ap rtc clock due to
clock source has been changed.
Change-Id: I00806873df732937eb41f4db68d5ccf3fcde6a4d
Signed-off-by: Kang KyungWoo <kwoo.kang@samsung.com>
Changki Kim [Fri, 12 Jun 2015 05:03:59 +0000 (14:03 +0900)]
[COMMON] rtc: rtc-s3c: remove need_src_clk flag of s3c6410
Change-Id: I167c5aca5698f79c5b48c96f9edce4fb1e7eaccd
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Jaehyoung Choi [Fri, 12 Jan 2018 13:19:50 +0000 (22:19 +0900)]
[COMMON] iio: adc: exynos_adc: Change idle-ip status sequence
Change-Id: Ie5e6f5a8502be080ccd3a7c241c50436dbaf72cb
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Choi Jaehyoung [Thu, 7 Sep 2017 07:31:37 +0000 (16:31 +0900)]
[COMMON] iio: adc: exynos_adc: Fix prevent defect
CID: 197183 - Constant variable guards dead code.
Change-Id: Ibdead8ca606d8473257889e5a6bebcda2865885f
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Choi Jaehyoung [Mon, 17 Apr 2017 12:18:03 +0000 (21:18 +0900)]
[COMMON] driver: exynos_adc: add Semaphore for peterson algorithm.
The peterson algorithm is applied to prevent race condition between CHUB and AP.
Change-Id: Ic9b4790d42bcbe2ab38434a10149b1377dbc45f8
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Kyungwoo Kang [Wed, 12 Apr 2017 07:23:15 +0000 (16:23 +0900)]
[COMMON] adc: exynos_adc: Add a define to distinct from mainline
Change-Id: If23a91af1940700be3317f9503037279c9a5066f
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Kang KyungWoo [Tue, 18 Oct 2016 05:00:55 +0000 (14:00 +0900)]
[COMMON] iio: adc: Extend max channel number.
This patch is for extending max channel from 8 to 12.
Change-Id: Ideae06e06fb42e0adf430a466e3807e3cf2fb9fb
Signed-off-by: Kang KyungWoo <kwoo.kang@samsung.com>
Matthew Leung [Fri, 24 Apr 2015 11:00:17 +0000 (20:00 +0900)]
[COMMON] iio: exynos_adc: add IDLE_IP updates.
Change-Id: I304eb532e6827b504790768514626b00dec4931d
Signed-off-by: Matthew Leung <matt.leung@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Changki Kim [Fri, 3 Jul 2015 07:34:54 +0000 (16:34 +0900)]
[COMMON] iio: exynos_adc: Add ADC v3 for sharing adc
Ap and cp share ADC after J series.
So we add adc v3 for sharing ADC.
Change-Id: I83348bdef114f5bc403f6e37cf324c243768d290
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Hyunki Koo [Thu, 18 Dec 2014 14:03:13 +0000 (23:03 +0900)]
[COMMON] iio: exynos_adc: change ADC_V2_CON2_C_TIME from 0 to 6
This patch change CTIME value from 1 to 64 to reduce measurement deviation.
CTIME means the sampling number of measurement.
Change-Id: Ide0de728ab21f0bd71a705fffb30956929f4e84d
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Changki Kim [Wed, 27 Apr 2016 04:57:57 +0000 (13:57 +0900)]
[COMMON] iio: exynos_adc: Insert enable_irq/disable_irq
If interrupt is handled after clock is disable,
external abort on non-linefetch is occurred.
This patch disable interrupt before disable clock
and enable interrupt after enable clock to avoid external abort.
Change-Id: I028bd20ecd768ee3d2820249ab64dd1aae6b132e
Signed-off-by: Eunki Kim <eunki_kim@samsung.com>
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Changki Kim [Thu, 11 Jun 2015 00:17:26 +0000 (09:17 +0900)]
[COMMON] iio: exynos_adc: Add clock control
Change-Id: I71da0bf59818f76b5b9bf0c03645afbc82f84f79
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
lakkyung.jung [Tue, 27 Aug 2013 10:47:23 +0000 (19:47 +0900)]
[COMMON] iio: exynos_adc: Modified to control adc phy & regulator control.
In case of exynos5430, the register of phy control in PMU was removed.
In the case of a some board, could be performed normally without
controlling regulator.
Change-Id: Idacfe3de2e9e6d705f28092e6bd93b3afb9cc30f
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Jaehyoung Choi [Fri, 12 Jan 2018 13:10:15 +0000 (22:10 +0900)]
[COMMON] pwm: pwm-samsung: Change ip_idle_status sequence
ip_idle_status function is used according PM config
Change-Id: I0d7cab11c390fd954b3debda0ab2b8d6bd8473d2
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Jaehyoung Choi [Wed, 13 Sep 2017 05:33:45 +0000 (14:33 +0900)]
[COMMON] pwm: pwm-samsung: Add debug function
Change-Id: I00624db6019b435c6c5c936cf8b4255d72a6ce59
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Jaehyoung Choi [Thu, 23 Nov 2017 10:06:23 +0000 (19:06 +0900)]
[COMMON] pwm: pwm-samsung: Fix Prevent defect
CID[202165], CID[202131], CID[202076]
Fix Invalid Assignment issue
Change-Id: I73e984c0eff678740ecb41601d493aef26c33b0e
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Jaehyoung Choi [Fri, 3 Nov 2017 04:59:43 +0000 (13:59 +0900)]
[COMMON] pwm: pwm-samsung: Change clock enable/disable sequence
clk_prepare function uses mutex lock.
If user area use spinlock, kernel panic occured.
Change-Id: I6cdb245d1143a1f82397b4c3b4fee8488c1a3b5b
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Choi Jaehyoung [Tue, 25 Jul 2017 11:17:40 +0000 (20:17 +0900)]
[COMMON] pwm: pwm-samsung: Initialize PWM Divider, Prescaler.
The reason for initializing PWM Divider and Prescaler is as follows.
- In the past, init function in clk-exynos-pwm.c initialized
Divider and Prescaler, but no longer uses the clk-exynos-pwm.c file.
Therefore, they must be initialized at the time of kernel probe.
- The current bootloader sets the Divider and Prescaler values to use PWM.
After the bootloader finishes, they must be initizlized in kernel.
Change-Id: I9bd0f8e869209380153582bb28a759892ff06ca2
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Changki Kim [Thu, 29 Oct 2015 10:29:57 +0000 (19:29 +0900)]
[COMMON] pwm: pwm-samsung: Add to control sclk
PWM clock source use pclk(66M), sclk(OSC).
The existing base_clk is changed to pclk.
Change-Id: Ib70f0ee25f1ff1c28efc79d1c9733e94086cb263
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Choi Jaehyoung [Wed, 3 May 2017 13:49:54 +0000 (22:49 +0900)]
[COMMON] pwm-samsung.c: Removed code that used undeclared clocks
I removed the code that used the clocks removed from the previous kernel 4.9 patch.
previous patch commit:
fbab471335f60c1e92fa436b2ea4b1c8addecdd3
Change-Id: I2c4dde391bc889ab2deb2e1068573ac4a7ff47cb
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Kang KyungWoo [Tue, 13 Dec 2016 08:09:44 +0000 (17:09 +0900)]
[COMMON] drivers: pwm: Fix pwm driver to save and restore.
This patch is for fixing pwm driver which influences pwm malfunction
after suspend & resume funtcion.
Checking Enable count is originally for LPA mode which is not
exist anymore.
Change-Id: I330362bdd10af00f15761cd9dc7613b21d107d35
Signed-off-by: Kang KyungWoo <kwoo.kang@samsung.com>
Changki Kim [Wed, 22 Apr 2015 06:09:12 +0000 (15:09 +0900)]
[COMMON] pwm: samsung: Add to update idle status register.
Clk rate value is assigned when clk_get_rate is used in virtual clk.
So we must calculate rate after get rate of pclk_pwm.
Change-Id: Ifccf67b7feb73aa4188b1ebdbef83da64707174f
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
eunki.kim [Mon, 23 Sep 2013 05:24:41 +0000 (14:24 +0900)]
[COMMON] pwm: samsung: support 0% and 100% duty cycle
PWM generates a pulse within a specific period repeatedly.
However, some drivers require duty cycle 0% or 100% to PWM. This
patch supports them on S3C64XX and EXYNOS series only. It does not
support them on S3C24XX series.
100% duty cycle: TCMPB >= TCNTB, invert set
0% duty cycle: clear auto-reload
Change-Id: I5ad41f60d848c054f54581fe70e3fcc93e2efbfa
Signed-off-by: eunki.kim <eunki_kim@samsung.com>
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
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>
Choi Jaehyoung [Thu, 7 Sep 2017 05:01:16 +0000 (14:01 +0900)]
[COMMON] watchdog: s3c_2410_wdt: Fix prevent defect.
CID: 197431 - Pointer to local outside scope.
Change-Id: I64b39e2d0660e6a51611e4ebe1c01f1fc45b4e86
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Hosung Kim [Fri, 26 May 2017 06:36:16 +0000 (15:36 +0900)]
[COMMON] watchdog: s3c2410_wdt: fix panic handler owner to cluster 0
This patch fixes to assign panic handler to cluster 1.
only cluster 0 should run emergency reset.
Change-Id: I569624baec898c5a52cd3e3672383de3e64f1f09
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
Choi Jaehyoung [Tue, 16 May 2017 03:59:22 +0000 (12:59 +0900)]
[COMMON] watchdog: s3c2410_wdt: Snapshot can control two watchdogs
Watchdog driver code should support Snapshot to control Cluster0, Cluster1 watchdog.
Change-Id: Ide10db8d6af6587d3c20b6ac6728446ff88e104d
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Changki Kim [Mon, 6 Mar 2017 05:42:41 +0000 (14:42 +0900)]
[COMMON] watchdog: s3c2410_wdt: Only watchdog kicking for suspend
When the system is stuck, it must be reset.
This patch gurantees the reset before entering the suspend.
Change-Id: Ic31244748fc9e8232faa7837e7bbb9ed7c52f209
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Changki Kim [Fri, 3 Mar 2017 05:37:33 +0000 (14:37 +0900)]
[COMMON] watchdog: s3c2410_wdt: Change device to syscore PM function
Change-Id: Id3a35873afe3222f817ef56123b9cd8d6862df1d
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Hyunki Koo [Tue, 14 Feb 2017 08:03:05 +0000 (00:03 -0800)]
[COMMON] watchdog: s3c2410_wdt: change function to inline type
Change-Id: I5014b3266b2681e896bc371c7f467e791f68056b
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Changki Kim [Tue, 17 Jan 2017 01:29:24 +0000 (10:29 +0900)]
[COMMON] watchdog: s3c2410_wdt: Change to get clock freq
If cpu lockup is occured mutex lock in clk funtion,
watchdog may not start in urgent situations because of clk funtion.
Change-Id: Idf935d72afd521cd5586d67eceacef968a672c5f
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Hosung Kim [Tue, 13 Dec 2016 10:18:53 +0000 (19:18 +0900)]
[COMMON] trace: ess: DO NOT stop to kick watchdog
In 4.9 kernel, I excluded 'exynos-ss.c' file from this patch.
This commit prevents hang status during the panic sequence.
Watchdog kick is alived. This does not matter to enable/disable
watchdogd.
Change-Id: I29b154043e3c7291d0ac8dc5f2c78721f9083607
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Hyunki Koo [Sat, 24 Oct 2015 10:29:22 +0000 (19:29 +0900)]
[COMMON] watchdog: s3c2410_wdt: add set_emergency_reset function
This patch add set_emergency_reset function for safe panic handler
Change-Id: Ief3672cfc1ab90178c8b36aa17db310946555ad3
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Hyunki Koo [Thu, 24 Oct 2013 08:55:45 +0000 (17:55 +0900)]
[COMMON] watchdog: s3c2410_wdt: change clock source to rate & gate clock
In 4.9 kernel porting,
Conflict:
- s3c2410wdt_set_min_max_timeout function. -> remove function
- Clock change within probe function. -> Changed to this patch.
Clock for watchdog device is changed to open gate clock.
but there is no clockrate information in gate_watchdog clock.
so rate_watchdog clock is added to get clock rate
Change-Id: I8394ac129bd478f5de6913e8c98f12cdebf0d87e
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Signed-off-by: Kang KyungWoo <kwoo.kang@samsung.com>
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
Hyunki Koo [Sun, 9 Aug 2015 07:20:49 +0000 (16:20 +0900)]
trace: ess: change reset policy after panic occurred
In 4.9 kernel porting,
I excluded 'exynos-ss.c' file from this patch.
This patch changes the reset policy in exynos-snapshot after kernel
panic occurred. It is changed from watchdog reset to s/w reset, but
if hardlockup is detection at any cores, watchdog reset should be
used to get the information from cores.
This reset policy is only applied when EXYNOS_SNAPSHOT_WATCHDOG_RESET
enabled. Exynos-snapshot supports adding for more action in pre/post
panic function.
Change-Id: I21cbae6281c6db5482a52af5478143a524854aff
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Signed-off-by: Choi Jaehyoung <jkkkkk.choi@samsung.com>
Changki Kim [Thu, 31 Dec 2015 05:45:40 +0000 (14:45 +0900)]
watchdog: s3c2410_wdt: fix resume sequence
When AUTOMATIC_DISABLE_WDT regster in PMU is set 1 and
APL cores are power down, watchdog registers is set reset value.
So we change resume sequence.
Change-Id: I397e5627a4d0a869ffe756fb19d165886d13952a
Signed-off-by: Changki Kim <changki.kim@samsung.com>
Sungjinn Chung [Thu, 27 Nov 2014 13:18:15 +0000 (22:18 +0900)]
watchdog: s3c2410_wdt: fix spinlock inconsistent lock state warning
This patch is to fix spinlock warning.
< 4>[ 204.229499] I[1: BootAnimation: 2990] =================================
< 4>[ 204.229517] I[1: BootAnimation: 2990] [ INFO: inconsistent lock state ]
< 4>[ 204.229538] I[1: BootAnimation: 2990] 3.10.58-
3388584-eng #1 Not tainted
< 4>[ 204.229557] I[1: BootAnimation: 2990] ---------------------------------
< 4>[ 204.229576] I[1: BootAnimation: 2990] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
< 4>[ 204.229597] I[1: BootAnimation: 2990] BootAnimation/2990 [HC1[1]:SC0[0]:HE0:SE1] takes:
< 4>[ 204.229617] I[1: BootAnimation: 2990] (wdt_lock){?.+...}, at: [<
ffffffc0005762c4>] s3c2410wdt_stop+0x1c/0x38
< 4>[ 204.229677] I[1: BootAnimation: 2990] {HARDIRQ-ON-W} state was registered at:
< 4>[ 204.229696] I[1: BootAnimation: 2990] [<
ffffffc0000efa04>] mark_lock+0x304/0x6e4
< 4>[ 204.229725] I[1: BootAnimation: 2990] [<
ffffffc0000f0cbc>] __lock_acquire+0x968/0x19b8
< 4>[ 204.229751] I[1: BootAnimation: 2990] [<
ffffffc0000f2454>] lock_acquire+0xf4/0x128
< 4>[ 204.229775] I[1: BootAnimation: 2990] [<
ffffffc00081dcf8>] _raw_spin_lock+0x38/0x50
< 4>[ 204.229802] I[1: BootAnimation: 2990] [<
ffffffc0005764f8>] s3c2410wdt_stop_intclear.isra.1+0x18/0x50
< 4>[ 204.229827] I[1: BootAnimation: 2990] [<
ffffffc000576830>] s3c2410wdt_probe+0x1f4/0x444
Change-Id: I5fa03e75f6ba68b6dc58a116d134b21b7d53550e
Signed-off-by: Sungjinn Chung <sungjinn.chung@samsung.com>