23 Mar, 2016
1 commit
-
Pull i2c updates from Wolfram Sang:
"Mostly usual driver updates and improvements. The changelog should
give an idea. Standing out is the i2c-qup driver with lots of new
capabilities and we also have now an i2c-demuxer.I'd especially like to welcome Peter Rosin as the i2c-mux maintainer.
He has an interesting series for muxes in the queue and agreed to look
after this part of the subsystem. Thank you, Peter, and welcome
again!The octeon changes were applied pretty recently before the merge
window. I am aware. They are the first (and relatively simple)
patches of a larger overhaul to this driver. In case something goes
wrong with them, they are easy to fix (or revert). The advantage I
see is that they are out of the way, and I can concentrate on the next
block of patches. I really would like to apply the overhaul in
smaller batches to avoid regressions. And waiting a cycle for the
introductory patches seemed too much of a delay for me"* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (39 commits)
i2c: octeon: Support I2C_M_RECV_LEN
i2c: octeon: Cleanup resource allocation code
i2c: octeon: Cleanup i2c-octeon driver
MAINTAINERS: add Peter Rosin as i2c mux maintainer
dt-bindings: i2c: Spelling s/propoerty/property/
i2c: immediately mark ourselves as registered
i2c: i801: sort IDs alphabetically
MAINTAINERS: Mika and me are designated reviewers for I2C DESIGNWARE
i2c: octeon: Cleanup kerneldoc comments
i2c: do not use internal data from driver core
i2c: cadence: Fix the kernel-doc warnings
i2c: imx: remove extra spaces.
i2c: rcar: don't open code of_device_get_match_data()
i2c: qup: Fix fifo handling after adding V2 support
i2c: xiic: Implement power management
i2c: piix4: Pre-shift the port number
i2c: piix4: Always use the same type for port
i2c: piix4: Support alternative port selection register
i2c: tegra: don't open code of_device_get_match_data()
i2c: riic, sh_mobile, rcar: Use ARCH_RENESAS
...
18 Mar, 2016
3 commits
-
If I2C_M_RECV_LEN is set consider the length byte.
Signed-off-by: David Daney
Signed-off-by: Jan Glauber
Signed-off-by: Wolfram Sang -
Remove resource values from struct i2c_octeon and use
devm_ioremap_resource helper.Signed-off-by: Jan Glauber
Signed-off-by: Wolfram Sang -
Cleanup only without functional change.
- removed DRV_VERSION
- defines: use defines instead of plain values,
use BIT_ULL macro, add comments
- rename waitqueue return value to time_left
- sort local variables by length
- fix indentation and whitespace errors
- make function return void if the result is not used
(octeon_i2c_stop, octeon_i2c_set_clock)
- remove debug code from octeon_i2c_stop
- renamed some functions for readability
- update copyrightSigned-off-by: Jan Glauber
Signed-off-by: Wolfram Sang
15 Mar, 2016
1 commit
-
Mark the i2c bus as registered right after the the bus_register call,
not at the end of init. Otherwise, we can't register our own dummy
driver.Reported-by: Thierry Reding
Signed-off-by: Wolfram Sang
Fixes: 95026658c46ea2 ("i2c: do not use internal data from driver core")
12 Mar, 2016
4 commits
-
Sort the list to have a faster search for a certain PCI ID.
There is no functional change.
Signed-off-by: Andy Shevchenko
Signed-off-by: Wolfram Sang -
Remove point after parameter description and replace kerneldoc
by a comment if it has no additional no value.Signed-off-by: Jan Glauber
Signed-off-by: Wolfram Sang -
The variable p is a data structure which is used by the driver core
internally and it is not expected that busses will be directly accessing
these driver core internal only data.Signed-off-by: Sudip Mukherjee
Acked-by: Greg Kroah-Hartman
[wsa: removed the unlikely()]
Signed-off-by: Wolfram Sang -
This fixes the below warnings
drivers/i2c/busses/i2c-cadence.c:164: warning: No description found for parameter 'dev'
drivers/i2c/busses/i2c-cadence.c:826: warning: No description found for parameter 'dev'
drivers/i2c/busses/i2c-cadence.c:826: warning: Excess function parameter '_dev' description in 'cdns_i2c_runtime_suspend'
drivers/i2c/busses/i2c-cadence.c:844: warning: No description found for parameter 'dev'
drivers/i2c/busses/i2c-cadence.c:844: warning: Excess function parameter '_dev' description in 'cdns_i2c_runtime_resume'while at it also update the cdns_i2c_clear_bus_hold
and the runtime function update.Tested-by: Michal Simek
Signed-off-by: Shubhrajyoti Datta
Signed-off-by: Wolfram Sang
11 Mar, 2016
1 commit
-
Add device HID AMDI0010 to match the AMD ACPI Vendor ID (AMDI) that
was registered in http://www.uefi.org/acpi_id_list, and the I2C
controller on future AMD paltform will use the HID instead of AMD0010.Signed-off-by: Xiangliang Yu
Acked-by: Jarkko Nikula
Signed-off-by: Rafael J. Wysocki
04 Mar, 2016
4 commits
-
Signed-off-by: Dmitriy Baranov
Signed-off-by: Wolfram Sang -
This change will also make Coverity happy by avoiding a theoretical NULL
pointer dereference; yet another reason is to use the above helper function
to tighten the code and make it more readable.Signed-off-by: Wolfram Sang
Acked-by: Geert Uytterhoeven
Signed-off-by: Wolfram Sang -
After the addition of V2 support, there was a regression observed
when testing it on MSM8996. The reason is driver puts the controller
in to RUN state and writes the data to be 'tx' ed in fifo. But controller
has to be put in to 'PAUSE' state and data has to written to fifo. Then
should be put in to 'RUN' state separately.Signed-off-by: Sricharan R
Tested-by: Pramod Gurav
Signed-off-by: Wolfram Sang -
Enable power management. This patch enables the clocks before transfer
and disables after the transfer. It also adds the clock description.Signed-off-by: Shubhrajyoti Datta
Acked-by: Rob Herring
Signed-off-by: Wolfram Sang
02 Mar, 2016
1 commit
-
We want the size of the struct, not of a pointer to it. To be future
proof, just dereference the pointer to get the desired type.Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver")
Acked-by: Gregory Fong
Acked-by: Florian Fainelli
Reviewed-by: Kamal Dasu
Signed-off-by: Wolfram Sang
Cc: stable@kernel.org
24 Feb, 2016
6 commits
-
Shift the port number at initialization time, so that it is ready to
use at run time. That way we don't have to do it again for every SMBus
transaction.Signed-off-by: Jean Delvare
Reviewed-by: Mika Westerberg
Signed-off-by: Wolfram Sang -
Sometimes u8 is used to store the port number, sometimes unsigned
short is used. Consistently stick to a single type, for consistency
and to avoid implicit casts.Signed-off-by: Jean Delvare
Reviewed-by: Mika Westerberg
Signed-off-by: Wolfram Sang -
The SB800 register reference guide says that the SMBus port selection
bits may not always be in register Smbus0En (0x2c) but could
alternatively be found in register Smbus0Sel (0x2e) depending on the
settings in register Smbus0SelEn (0x2f.) Add support for this
configuration.The "alternative" register is the only one working for the Bolton
(aka Hudson-2) chipset anyway. I do not have any documentation for
the "kerncz" chipset so we treat it the same as the Bolton for now.Signed-off-by: Jean Delvare
Tested-by: Christian Fetzer
Reviewed-by: Mika Westerberg
Signed-off-by: Wolfram Sang -
This change will also make Coverity happy by avoiding a theoretical NULL
pointer dereference; yet another reason is to use the above helper function
to tighten the code and make it more readable.Signed-off-by: Wolfram Sang
Acked-by: Laxman Dewangan
Tested-by: Laxman Dewangan -
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.
This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.Signed-off-by: Simon Horman
Acked-by: Geert Uytterhoeven
Signed-off-by: Wolfram Sang -
QUP cores can be attached to a BAM module, which acts as
a dma engine for the QUP core. When DMA with BAM is enabled,
the BAM consumer pipe transmitted data is written to the
output FIFO and the BAM producer pipe received data is read
from the input FIFO.With BAM capabilities, qup-i2c core can transfer more than
256 bytes, without a 'stop' which is not possible otherwise.Signed-off-by: Sricharan R
Reviewed-by: Andy Gross
Tested-by: Archit Taneja
Tested-by: Telkar Nagender
Signed-off-by: Wolfram Sang
21 Feb, 2016
6 commits
-
I request this for drivers, so the core should adhere to sorted includes as
well.Signed-off-by: Wolfram Sang
-
I request this for drivers, so the core should adhere to sorted includes as
well.Signed-off-by: Wolfram Sang
-
I request this for drivers, so the core should adhere to sorted includes as
well.Signed-off-by: Wolfram Sang
-
I request this for drivers, so the core should adhere to sorted includes as
well.Signed-off-by: Wolfram Sang
-
I request this for drivers, so the core should adhere to sorted includes as
well.Signed-off-by: Wolfram Sang
-
I request this for drivers, so the core should adhere to sorted includes as
well.Signed-off-by: Wolfram Sang
18 Feb, 2016
1 commit
-
Starting from Intel Sunrisepoint (Skylake PCH) the iTCO watchdog
resources have been moved to reside under the i801 SMBus host
controller whereas previously they were under the LPC device.This patch adds Intel lewisburg SMBus support for iTCO device.
It allows to load watchdog dynamically when the hardware is
present.Fixes: cdc5a3110e7c ("i2c: i801: add Intel Lewisburg device IDs")
Reviewed-by: Jean Delvare
Signed-off-by: Alexandra Yates
Signed-off-by: Wolfram Sang
Cc: stable@kernel.org
13 Feb, 2016
12 commits
-
The current iProc I2C driver only allows each TX transfer up to 63
bytes (the TX FIFO has a size of 64 bytes, and one byte is reserved
for slave address). This patch enhances the driver to support TX
transfer in each I2C message for up to 65535 bytes (a practical
maximum, since member 'max_write_len' of 'struct i2c_adapter_quirks is
of type 'u16')This works by loading up the I2C TX FIFO and enabling the TX underrun
interrupt for each burst. After each burst of TX data is finished,
i.e., when the TX FIFO becomes empty, the TX underrun interrupt will be
triggered and another burst of TX data can be loaded into the TX FIFO.
This repeats until all TX data are finishedSigned-off-by: Ray Jui
Tested-by: Icarus Chau
Reviewed-by: Scott Branden
Signed-off-by: Wolfram Sang -
Fix typo in the driver from 'I2C_TIMEOUT_MESC' to 'I2C_TIMEOUT_MSEC'
Signed-off-by: Ray Jui
Reviewed-by: Scott Branden
Signed-off-by: Wolfram Sang -
Add proper recovery mechanism to the iProc I2C driver in error cases.
Signed-off-by: Icarus Chau
Signed-off-by: Ray Jui
Tested-by: Icarus Chau
Reviewed-by: Scott Branden
[wsa: whitespace fixes]
Signed-off-by: Wolfram Sang -
Add COMPILE_TEST for the compilation test coverage.
Signed-off-by: Masahiro Yamada
Signed-off-by: Wolfram Sang -
If 4GB mode is enabled, we should add 4GB DMA mode support in i2c
driver. Set 4GB mode register to support 4GB mode.Signed-off-by: Liguo Zhang
Reviewed-by: Daniel Kurtz
Reviewed-by: Yingjoe Chen
[wsa: updated commit message]
Signed-off-by: Wolfram Sang -
There can be unnecessary runtime suspend-resume cycle during
i2c-designware-platdrv probe when it registers the I2C adapter device. This
happens because i2c-designware-platdrv is set to initially active platform
device in its probe function and is a parent of I2C adapter.In that case power.usage_count of i2c-designware device is zero and
pm_runtime_get()/pm_runtime_put() cycle during probe could put it into
runtime suspend. This happens when the i2c_register_adapter() calls the
device_register():i2c_register_adapter
device_register
device_add
bus_probe_device
device_initial_probe
__device_attach
if (dev->parent) pm_runtime_get_sync(dev->parent)
...
if (dev->parent) pm_runtime_put(dev->parent)After that the i2c_register_adapter() continues registering I2C slave
devices. In case slave device probe does I2C transfers the parent will
resume again and thus get a needless runtime suspend/resume cycle during
adapter registration.Prevent this while retaining the runtime PM status of i2c-designware by
only incrementing/decrementing device power usage count during I2C
adapter registration. That makes sure there won't be spurious runtime PM
status changes and lets the driver core to idle the device after probe
finishes.Signed-off-by: Jarkko Nikula
Acked-by: Mika Westerberg
Signed-off-by: Wolfram Sang -
The i2c-designware-platform module has duplicate module information
when CONFIG_I2C_DESIGNWARE_BAYTRAIL is set. It gets the information
from both i2c-designware-platdrv and i2c-designware-baytrail. The
latter is optional extra code which ends up in the same module so it
should not export module information.Signed-off-by: Jean Delvare
Acked-by: Jarkko Nikula
Signed-off-by: Wolfram Sang -
The per adapter bus_lock already projects from concurrent calls to the
master_xfer callback. No need to add a driver internal lock.Also, rephrase a comment to drop mention of this lock.
Reported-by: Rongrong Zou
Signed-off-by: Baruch Siach
Acked-by: Mika Westerberg
Signed-off-by: Wolfram Sang -
Signed-off-by: Masahiro Yamada
Signed-off-by: Wolfram Sang -
Commit 5de85b9d57ab ("PM / runtime: Re-init runtime PM states at probe
error and driver unbind") introduced pm_runtime_reinit() that is used
to reinitialize PM runtime after -EPROBE_DEFER. This allows shutting
down the device after a failed probe.However, for drivers using pm_runtime_use_autosuspend() this can cause
a state where suspend callback is never called after -EPROBE_DEFER.
On the following device driver probe, hardware state is different from
the PM runtime state causing omap_device to produce the following
error:omap_device_enable() called from invalid state 1
And with omap_device and omap hardware being picky for PM, this will
block any deeper idle states in hardware.The solution is to fix the drivers to follow the PM runtime documentation:
1. For sections of code that needs the device disabled, use
pm_runtime_put_sync_suspend() if pm_runtime_set_autosuspend() has
been set.2. For driver exit code, use pm_runtime_dont_use_autosuspend() before
pm_runtime_put_sync() if pm_runtime_use_autosuspend() has been
set.Fixes: 5de85b9d57ab ("PM / runtime: Re-init runtime PM states at probe
error and driver unbind")
Signed-off-by: Tony Lindgren
Acked-by: Ulf Hansson
Signed-off-by: Wolfram Sang -
The definition of i2c_msg says that
"If this is the last message in a group, it is followed by a STOP.
Otherwise it is followed by the next @i2c_msg transaction segment,
beginning with a (repeated) START"So the expectation is that there is no 'STOP' bit inbetween individual
i2c_msg segments with repeated 'START'. Adding the support for the same.This is required for some clients like touchscreen which keeps
incrementing counts across individual transfers and 'STOP' bit inbetween
resets the counter, which is not required.This patch adds the support in non-dma mode.
Signed-off-by: Sricharan R
Reviewed-by: Andy Gross
Tested-by: Archit Taneja
Tested-by: Telkar Nagender
[wsa: updated commit message]
Signed-off-by: Wolfram Sang -
QUP from version 2.1.1 onwards, supports a new format of
i2c command tags. Tag codes instructs the controller to
perform a operation like read/write. This new tagging version
supports bam dma and transfers of more than 256 bytes without 'stop'
in between. Adding the support for the same.For each block a data_write/read tag and data_len tag is added to
the output fifo. For the final block of data write_stop/read_stop
tag is used.Signed-off-by: Andy Gross
Signed-off-by: Sricharan R
Tested-by: Archit Taneja
Tested-by: Telkar Nagender
Signed-off-by: Wolfram Sang