15 Nov, 2018
1 commit
-
The bug is when using i2cdetect in DomU, some i2c device will be
skiped, fixed this through add I2C_FUNC_SMBUS_QUICK functionality.Signed-off-by: Flynn xu
13 Nov, 2018
2 commits
-
Fixes build warning introduced by
90e818a0abcc("MLK-20342 i2c: xen-i2cback/front: Add i2c_smbus interface")Signed-off-by: Peng Fan
-
Add smbus_xfer interface in xen-i2cback/front driver.
Reviewed-by: Peng Fan
Signed-off-by: Flynn xu
12 Nov, 2018
1 commit
-
Fix uninitalized variable
Signed-off-by: Flynn xu
Reviewed-by: Peng Fan
05 Nov, 2018
2 commits
-
Fix Coverity id 5186949 5187047, uninitialized variables.
Signed-off-by: Peng Fan
-
When req.num_msg is less than 2, also need initialze num_msg.
Also modify the if/else if to use num_msgSigned-off-by: Peng Fan
29 Oct, 2018
16 commits
-
Add i2c backend frontend support.
The transaction only support one msg each time.
The frontend sends a request to backend, backend use i2c_transfer
to do real transaction to hardware and return the results to frontend.Now i2cdump/get/set works.
In domu cfg file, use
"vi2c = ['backend=0,be-adapter=5a800000.i2c,addr=0x51;0x44']" to
create a dummy controller in frontend and allowed slaves in backend.Currently the slave address check not added, it will be supported in
furture patch.Signed-off-by: Peng Fan
-
add debug message when i2c peripheral clk rate is 0, then
directly return -EINVAL.Signed-off-by: Gao Pan
Reviewed-by: Andy Duan -
Manage irq resource request/release in runtime pm to save irq domain's
power.Signed-off-by: Frank Li
Signed-off-by: Fugang Duan
Tested-by: Guoniu.Zhou
Reviewed-by: Frank Li -
- Add runtime pm support to dynamicly manage the ipg and per clocks.
- Put the suspend to suspend_noirq.
- Call .pm_runtime_force_suspend() to force runtime pm suspended
in .suspend_noirq().BuildInfo:
- SCFW 88456c73, IMX-MKIMAGE 06bc2767, ATF a438801
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g7953d47Signed-off-by: Fugang Duan
Signed-off-by: Gao Pan
Reviewed-by: Anson HuangDuring 4.14 rebase added pm_runtime_get_sync/pm_runtime_put around
the reading of LPI2C_PARAM.Signed-off-by: Leonard Crestez
-
imx8mscale evk uses the i2c imx driver to control the pfuze driver
otherwise pfuze driver wont be probed with I2C_IMXChange-Id: Iaeacde58a4cbe34a3d18cb16814d2334c74c2b79
(cherry-picked from commit ad7200824fa740a1fe9d418d3f949ff97b083bdf)
Signed-off-by: guoyin.chen -
When we do system suspend, the runtime pm will be disabled, but we need
to control the PMIC to power on/off the regulator, if the runtime pm is
disabled, if will failed to request runtime wakeup. So data transfer will
failed.Signed-off-by: Bai Ping
Signed-off-by: Gao Pan -
use subsys_initcall for i2c driver to improve i2c driver probe priority
Signed-off-by: Gao Pan
-
Add i2c bus switch PCA9646 chip support, which 2-wire bus switch
and buffered 4-channel.Signed-off-by: Fugang Duan
-
The lpi2c IP needs two clks: ipg clk and per clk. The old lpi2c
driver missed ipg clk. This patch adds ipg clk for lpi2c driver.Signed-off-by: Gao Pan
-
add lpi2c driver dependency for ARM64
Signed-off-by: Gao Pan
-
restore pin setting for i2c in suspend/resume
Signed-off-by: Gao Pan
(cherry picked from commit 8aed73af218f25e0677b8980b3706246dd68790d)
Signed-off-by: Robin GongConflicts:
drivers/i2c/busses/i2c-imx.c -
Due to the eviation i2c clk settings, the result may less than
100KBps. As a result, some i2c slave works in wrong condition.This patch changes i2c bitrate to 200KBps
Signed-off-by: Gao Pan
-
A NACK flag in ISR means i2c bus error. In such codition,
there is no need to do read/write operation. It's better
to return ISR directly and then stop i2c transfer.Signed-off-by: Gao Pan
(cherry-pick from 839d59e48b6fdbd882776a48a88ce26ff14d8b86) -
During the 4.14 rebase the only relevant change was moving from imx8dv
to an imx8qm binding.Signed-off-by: Leonard Crestez
-
restore pin setting for i2c in suspend/resume
Signed-off-by: Gao Pan
-
The i2c irq is masked when pcie starts a i2c transfer process
during noirq suspend stage. As a result, i2c transfer fails.
To solve the problem, IRQF_NO_SUSPEND is added to i2c bus.Signed-off-by: Gao Pan
Signed-off-by: Fugang Duan
20 Oct, 2018
1 commit
-
commit 2b16fd63059ab9a46d473620749672dc342e1d21 upstream.
On Gen3, we can only do RXDMA once per transfer reliably. For that, we
must reset the device, then we can have RXDMA once. This patch
implements this. When there is no reset controller or the reset fails,
RXDMA will be blocked completely. Otherwise, it will be disabled after
the first RXDMA transfer. Based on a commit from the BSP by Hiromitsu
Yamasaki, yet completely refactored to handle multiple read messages
within one transfer.Signed-off-by: Wolfram Sang
Reviewed-by: Geert Uytterhoeven
Signed-off-by: Wolfram Sang
Cc: stable@kernel.org
Signed-off-by: Sudip Mukherjee
Signed-off-by: Greg Kroah-Hartman
18 Oct, 2018
1 commit
-
commit 08d9db00fe0e300d6df976e6c294f974988226dd upstream.
The i2c-scmi driver crashes when the SMBus Write Block transaction is
executed:WARNING: CPU: 9 PID: 2194 at mm/page_alloc.c:3931 __alloc_pages_slowpath+0x9db/0xec0
Call Trace:
? get_page_from_freelist+0x49d/0x11f0
? alloc_pages_current+0x6a/0xe0
? new_slab+0x499/0x690
__alloc_pages_nodemask+0x265/0x280
alloc_pages_current+0x6a/0xe0
kmalloc_order+0x18/0x40
kmalloc_order_trace+0x24/0xb0
? acpi_ut_allocate_object_desc_dbg+0x62/0x10c
__kmalloc+0x203/0x220
acpi_os_allocate_zeroed+0x34/0x36
acpi_ut_copy_eobject_to_iobject+0x266/0x31e
acpi_evaluate_object+0x166/0x3b2
acpi_smbus_cmi_access+0x144/0x530 [i2c_scmi]
i2c_smbus_xfer+0xda/0x370
i2cdev_ioctl_smbus+0x1bd/0x270
i2cdev_ioctl+0xaa/0x250
do_vfs_ioctl+0xa4/0x600
SyS_ioctl+0x79/0x90
do_syscall_64+0x73/0x130
entry_SYSCALL_64_after_hwframe+0x3d/0xa2
ACPI Error: Evaluating _SBW: 4 (20170831/smbus_cmi-185)This problem occurs because the length of ACPI Buffer object is not
defined/initialized in the code before a corresponding ACPI method is
called. The obvious patch below fixes this issue.Signed-off-by: Edgar Cherkasov
Acked-by: Viktor Krasnov
Acked-by: Michael Brunner
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman
10 Oct, 2018
2 commits
-
[ Upstream commit 4c85609b08c4761eca0a40fd7beb06bc650f252d ]
This driver currently emits a STOP if the next message is not
I2C_MD_RD. It should not do it because it disturbs the I2C_RDWR
ioctl, where read/write transactions are combined without STOP
between.Issue STOP only when the message is the last one _or_ flagged with
I2C_M_STOP.Fixes: 6a62974b667f ("i2c: uniphier_f: add UniPhier FIFO-builtin I2C driver")
Signed-off-by: Masahiro Yamada
Signed-off-by: Wolfram Sang
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
[ Upstream commit 38f5d8d8cbb2ffa2b54315118185332329ec891c ]
This driver currently emits a STOP if the next message is not
I2C_MD_RD. It should not do it because it disturbs the I2C_RDWR
ioctl, where read/write transactions are combined without STOP
between.Issue STOP only when the message is the last one _or_ flagged with
I2C_M_STOP.Fixes: dd6fd4a32793 ("i2c: uniphier: add UniPhier FIFO-less I2C driver")
Signed-off-by: Masahiro Yamada
Signed-off-by: Wolfram Sang
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
04 Oct, 2018
1 commit
-
[ Upstream commit 7fd6d98b89f382d414e1db528e29a67bbd749457 ]
Commit 7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to conflict
with PCI BAR") made it possible for AML code to access SMBus I/O ports
by installing custom SystemIO OpRegion handler and blocking i80i driver
access upon first AML read/write to this OpRegion.However, while ThinkPad T560 does have SystemIO OpRegion declared under
the SMBus device, it does not access any of the SMBus registers:Device (SMBU)
{
...OperationRegion (SMBP, PCI_Config, 0x50, 0x04)
Field (SMBP, DWordAcc, NoLock, Preserve)
{
, 5,
TCOB, 11,
Offset (0x04)
}Name (TCBV, 0x00)
Method (TCBS, 0, NotSerialized)
{
If ((TCBV == 0x00))
{
TCBV = (\_SB.PCI0.SMBU.TCOB << 0x05)
}Return (TCBV) /* \_SB_.PCI0.SMBU.TCBV */
}OperationRegion (TCBA, SystemIO, TCBS (), 0x10)
Field (TCBA, ByteAcc, NoLock, Preserve)
{
Offset (0x04),
, 9,
CPSC, 1
}
}Problem with the current approach is that it blocks all I/O port access
and because this system has touchpad connected to the SMBus controller
after first AML access (happens during suspend/resume cycle) the
touchpad fails to work anymore.Fix this so that we allow ACPI AML I/O port access if it does not touch
the region reserved for the SMBus.Fixes: 7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200737
Reported-by: Yussuf Khalil
Signed-off-by: Mika Westerberg
Reviewed-by: Jean Delvare
Signed-off-by: Wolfram Sang
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
26 Sep, 2018
1 commit
-
[ Upstream commit 517fde0eb5a8f46c54ba6e2c36e32563b23cb14f ]
This patch changes the order of enum aspeed_i2c_master_state and
enum aspeed_i2c_slave_state defines to make their initial value to
ASPEED_I2C_MASTER_INACTIVE and ASPEED_I2C_SLAVE_STOP respectively.
In case of multi-master use, if a slave data comes ahead of the
first master xfer, master_state starts from an invalid state so
this change fixes the issue.Signed-off-by: Jae Hyun Yoo
Reviewed-by: Brendan Higgins
Signed-off-by: Wolfram Sang
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
20 Sep, 2018
3 commits
-
[ Upstream commit 5799c4b2f1dbc0166d9b1d94443deaafc6e7a070 ]
This commit fixes this sparse warning:
drivers/i2c/busses/i2c-aspeed.c:875:38: warning: incorrect type in assignment (different modifiers)
drivers/i2c/busses/i2c-aspeed.c:875:38: expected unsigned int ( *get_clk_reg_val )( ... )
drivers/i2c/busses/i2c-aspeed.c:875:38: got void const *const dataReported-by: Wolfram Sang
Signed-off-by: Jae Hyun Yoo
Reviewed-by: Brendan Higgins
Signed-off-by: Wolfram Sang
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
commit 851a15114895c5bce163a6f2d57e0aa4658a1be4 upstream.
DNV's iTCO is slightly different with SMBCTRL sitting at a different
offset when compared to all other devices. Let's fix so that we can
properly use iTCO watchdog.Fixes: 84d7f2ebd70d ("i2c: i801: Add support for Intel DNV")
Cc: # v4.4+
Signed-off-by: Felipe Balbi
Reviewed-by: Jean Delvare
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman -
commit ae7304c3ea28a3ba47a7a8312c76c654ef24967e upstream.
Disable interrupts while configuring the transfer and enable them back.
We have below as the programming sequence
1. start and slave address
2. byte count and stopIn some customer platform there was a lot of interrupts between 1 and 2
and after slave address (around 7 clock cyles) if 2 is not executed
then the transaction is nacked.To fix this case make the 2 writes atomic.
Signed-off-by: Shubhrajyoti Datta
Signed-off-by: Michal Simek
[wsa: added a newline for better readability]
Signed-off-by: Wolfram Sang
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman
05 Sep, 2018
2 commits
-
[ Upstream commit 7b94ea50514d1a0dc94f02723b603c27bc0ea597 ]
If an i2c topology has instances of nested muxes, then a lockdep splat
is produced when when i2c_parent_lock_bus() is called. Here is an
example:============================================
WARNING: possible recursive locking detected
--------------------------------------------
insmod/68159 is trying to acquire lock:
(i2c_register_adapter#2){+.+.}, at: i2c_parent_lock_bus+0x32/0x50 [i2c_mux]but task is already holding lock:
(i2c_register_adapter#2){+.+.}, at: i2c_parent_lock_bus+0x32/0x50 [i2c_mux]other info that might help us debug this:
Possible unsafe locking scenario:CPU0
----
lock(i2c_register_adapter#2);
lock(i2c_register_adapter#2);*** DEADLOCK ***
May be due to missing lock nesting notation
1 lock held by insmod/68159:
#0: (i2c_register_adapter#2){+.+.}, at: i2c_parent_lock_bus+0x32/0x50 [i2c_mux]stack backtrace:
CPU: 13 PID: 68159 Comm: insmod Tainted: G O
Call Trace:
dump_stack+0x67/0x98
__lock_acquire+0x162e/0x1780
lock_acquire+0xba/0x200
rt_mutex_lock+0x44/0x60
i2c_parent_lock_bus+0x32/0x50 [i2c_mux]
i2c_parent_lock_bus+0x3e/0x50 [i2c_mux]
i2c_smbus_xfer+0xf0/0x700
i2c_smbus_read_byte+0x42/0x70
my2c_init+0xa2/0x1000 [my2c]
do_one_initcall+0x51/0x192
do_init_module+0x62/0x216
load_module+0x20f9/0x2b50
SYSC_init_module+0x19a/0x1c0
SyS_init_module+0xe/0x10
do_syscall_64+0x6c/0x1a0
entry_SYSCALL_64_after_hwframe+0x42/0xb7Reported-by: John Sperbeck
Tested-by: John Sperbeck
Signed-off-by: Peter Rosin
Signed-off-by: Peter Zijlstra (Intel)
Cc: Davidlohr Bueso
Cc: Deepa Dinamani
Cc: Greg Kroah-Hartman
Cc: Linus Torvalds
Cc: Peter Chang
Cc: Peter Zijlstra
Cc: Philippe Ombredanne
Cc: Thomas Gleixner
Cc: Will Deacon
Cc: Wolfram Sang
Link: http://lkml.kernel.org/r/20180720083914.1950-3-peda@axentia.se
Signed-off-by: Ingo Molnar
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
[ Upstream commit cc8de9a68599b261244ea453b38678229f06ada7 ]
If CLKH is set to 0 I2C clock is not generated at all, so avoid this value
and stretch the clock in this case.Signed-off-by: Alexander Sverdlin
Acked-by: Sekhar Nori
Signed-off-by: Wolfram Sang
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
24 Aug, 2018
2 commits
-
commit bed4ff1ed4d8f2ef5007c5c6ae1b29c5677a3632 upstream.
This fixes a race condition, where the DMAEN bit ends up being set after
I2C slave has transmitted a byte following the dummy read. When that
happens, an interrupt is generated instead, and no DMA request is generated
to kickstart the DMA read, and a timeout happens after DMA_TIMEOUT (1 sec).Fixed by setting the DMAEN bit before the dummy read.
Signed-off-by: Esben Haabendal
Acked-by: Uwe Kleine-König
Signed-off-by: Wolfram Sang
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman -
commit c463a158cb6c5d9a85b7d894cd4f8116e8bd6be0 upstream.
acpi_gsb_i2c_write_bytes() returns i2c_transfer()'s return value, which
is the number of transfers executed on success, so 1.The ACPI code expects us to store 0 in gsb->status for success, not 1.
Specifically this breaks the following code in the Thinkpad 8 DSDT:
ECWR = I2CW = ECWR /* \_SB_.I2C1.BAT0.ECWR */
If ((ECST == Zero))
{
ECRD = I2CR /* \_SB_.I2C1.I2CR */
}Before this commit we set ECST to 1, causing the read to never happen
breaking battery monitoring on the Thinkpad 8.This commit makes acpi_gsb_i2c_write_bytes() return 0 when i2c_transfer()
returns 1, so the single write transfer completed successfully, and
makes it return -EIO on for other (unexpected) return values >= 0.Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede
Acked-by: Mika Westerberg
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman
09 Aug, 2018
1 commit
-
commit 9f9e3e0d4dd3338b3f3dde080789f71901e1e4ff upstream.
Make sure to call reinit_completion() before dma is started to avoid race
condition where reinit_completion() is called after complete() and before
wait_for_completion_timeout().Signed-off-by: Esben Haabendal
Fixes: ce1a78840ff7 ("i2c: imx: add DMA support for freescale i2c driver")
Reviewed-by: Uwe Kleine-König
Signed-off-by: Wolfram Sang
Cc: stable@kernel.org
Signed-off-by: Sudip Mukherjee
Signed-off-by: Greg Kroah-Hartman
03 Aug, 2018
1 commit
-
commit e0638fa400eaccf9fa8060f67140264c4e276552 upstream.
Reference count of device node was increased in of_i2c_register_device,
but without decreasing it in i2c_unregister_device. Then the added
device node will never be released. Fix this by adding the of_node_put.Signed-off-by: Lixin Wang
Tested-by: Wolfram Sang
Signed-off-by: Wolfram Sang
Cc: stable@kernel.org
Signed-off-by: Sudip Mukherjee
Signed-off-by: Greg Kroah-Hartman
17 Jul, 2018
1 commit
-
commit 54836e2d03e76d80aec3399368ffaf5b7caadd1b upstream.
On Tegra30 Cardhu the PCA9546 I2C mux is not ACK'ing I2C commands on
resume from suspend (which is caused by the reset signal for the I2C
mux not being configured correctl). However, this NACK is causing the
Tegra30 to hang on resuming from suspend which is not expected as we
detect NACKs and handle them. The hang observed appears to occur when
resetting the I2C controller to recover from the NACK.Commit 77821b4678f9 ("i2c: tegra: proper handling of error cases") added
additional error handling for some error cases including NACK, however,
it appears that this change conflicts with an early fix by commit
f70893d08338 ("i2c: tegra: Add delay before resetting the controller
after NACK"). After commit 77821b4678f9 was made we now disable 'packet
mode' before the delay from commit f70893d08338 happens. Testing shows
that moving the delay to before disabling 'packet mode' fixes the hang
observed on Tegra30. The delay was added to give the I2C controller
chance to send a stop condition and so it makes sense to move this to
before we disable packet mode. Please note that packet mode is always
enabled for Tegra.Fixes: 77821b4678f9 ("i2c: tegra: proper handling of error cases")
Signed-off-by: Jon Hunter
Acked-by: Thierry Reding
Signed-off-by: Wolfram Sang
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman
21 Jun, 2018
2 commits
-
[ Upstream commit 35cd67a0caf767aba472452865dcb4471fcce2b1 ]
Returning zero is wrong in this case.
Signed-off-by: Peter Rosin
Signed-off-by: Wolfram Sang
Fixes: 174a13aa8669 ("i2c: Add viperboard i2c master driver")
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
[ Upstream commit 12d9bbc5a7f347eaa65ff2a9d34995cadc05eb1b ]
Returning -1 (-EPERM) is not appropriate here, go with -EIO.
Signed-off-by: Peter Rosin
Signed-off-by: Wolfram Sang
Fixes: 1b144df1d7d6 ("i2c: New PMC MSP71xx TWI bus driver")
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman