Commit graph

888396 commits

Author SHA1 Message Date
Luca Ceresoli da9a80bf19 docs: i2c: instantiating-devices: rearrange static instatiation
Among the "static" instantiation methods the "board file" method is
described first. Move it as last, since it is being replaced by the other
methods.

Also fix subsubsection heading syntax and remove the "Method 1[abc]"
prefix as the subsubsection structure clarifies the logical hierarchy.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:52 +01:00
Luca Ceresoli 4f71daf629 docs: i2c: instantiating-devices: fix internal hyperlink
Use ReST syntax so that a proper hyperlink is generated.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:51 +01:00
Luca Ceresoli 95b83774e3 docs: i2c: smbus-protocol: improve I2C Block transactions description
Clarify from the beginning what these transactions are, and specifically
how they differ from the SMBus counterparts, i.e. the lack of a Count byte.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:49 +01:00
Luca Ceresoli c7148b059c docs: i2c: smbus-protocol: fix punctuation
Remove misplaced dot before colon.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:47 +01:00
Luca Ceresoli 414a596454 docs: i2c: smbus-protocol: fix typo
The subject is plural, fix the verb.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:46 +01:00
Luca Ceresoli b36cbb70e4 docs: i2c: smbus-protocol: fix kernel-doc function syntax
This clarifies these are functions (and would/will adds a hyperlink to the
function documentation if/when documented).

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:44 +01:00
Luca Ceresoli 3c13f1fbec docs: i2c: smbus-protocol: enable kernel-doc function syntax
Hyperlinks from function names are not generated in headings. Move them in
the plain text so they are rendered as clickable hyperlinks.

While there also remove an unneeded colon in a heading.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:42 +01:00
Luca Ceresoli 9e89d61878 docs: i2c: smbus-protocol: use proper names for ACK and NACK
Use the proper ACK and NACK naming from the I2C specification instead of
"accept" and "reverse accept".

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:41 +01:00
Luca Ceresoli 026c0fe666 docs: i2c: smbus-protocol: remove unneeded colons from table
These colons are not needed: the columns already nicely separate the
symbols from their description. They are also inconsistently preceded by
whitespace.

Remove the colons completely to simplify and clean up.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:39 +01:00
Luca Ceresoli c0faa8a6be docs: i2c: smbus-protocol: properly name start and stop conditions
In I2C there is no such thing as a "start bit" or a "stop bit". Use the
proper naming: "start condition" and "stop condition".

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:37 +01:00
Luca Ceresoli 924fbb4d2e docs: i2c: smbus-protocol: fix link syntax
Use the proper ReST syntax to generate a valid hyperlink.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:36 +01:00
Luca Ceresoli db0d7424e7 docs: i2c: i2c-protocol: use proper names for ACK and NACK
Use the proper ACK and NACK naming from the I2C specification instead of
"accept" and "reverse accept".

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:34 +01:00
Luca Ceresoli 02622c8861 docs: i2c: i2c-protocol: remove unneeded colons from table
These colons are not needed: the columns already nicely separate the
symbols from their description. They are also inconsistently preceded by
whitespace.

Remove the colons completely to simplify and clean up.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:32 +01:00
Luca Ceresoli f954731d2a docs: i2c: i2c-protocol: properly name start and stop conditions
In I2C there is no such thing as a "start bit" or a "stop bit". Use the
proper naming: "start condition" and "stop condition".

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:30 +01:00
Luca Ceresoli f72beb8bf9 docs: i2c: i2c-protocol: fix kernel-doc function syntax
This clarifies these are functions and adds a hyperlink to the function
documentation.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:29 +01:00
Luca Ceresoli 48ca3b7fb8 docs: i2c: replace "I2C-transfer" -> "I2C transfer" consistently
"I2C transfer" is a legitimate english sentence, no need for a hyphen
between the two words, as as such it is used in most of the
documentation. Remove the hyphen in the few places where it is present.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:27 +01:00
Luca Ceresoli 40c573d12e docs: i2c: fix typo
Fix "issus" -> "issues".

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:25 +01:00
Luca Ceresoli 2f07c05f14 docs: i2c: call it "I2C" consistently
Uppercase "I2C" is used almost everywhere in the docs, but the lowercase
version "i2c" is used somewhere. Use the uppercase form consistently.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:24 +01:00
Luca Ceresoli 020bc5b929 docs: i2c: summary: rewrite the "terminology" section
This section, partly dating back to the pre-git era, is somewhat
unclear and partly incorrect. Rewrite it almost completely including a
reference figure, concise but precise definition of each term and the
paths where drivers are found. Particular care has been put in clarifying
the relation between adapter and algorithm, which has no correspondence
in the I2C spec terminology.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:16 +01:00
Luca Ceresoli 096c22f88e docs: i2c: summary: extend introduction
- state the "official" name (I²C, not I2C, according to the spec) at
   the beginning but keep using the more practical I2C elsewhere
 - mention some known different names
 - add link to the specification document

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:13 +01:00
Luca Ceresoli 2159393808 docs: i2c: sort index logically
The index page currently lists sections in alphabetical file order without
caring about their content. Sort sections based on their content logically,
according to the following structure:

 * Intro to I2C/SMBus and their usage in Linux: summary, i2c-protocol,
   smbus-protocol, instantiating-devices, busses/index, i2c-topology,
   muxes/i2c-mux-gpio
 * Implementing drivers: writing-clients, dev-interface,
   dma-considerations, fault-codes, functionality
 * Debugging: gpio-fault-injection, i2c-stub
 * Slave I2C: slave-interface, slave-eeprom-backend
 * Advanced: ten-bit-addresses
 * Obsolete info: upgrading-clients, old-module-parameters

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 22:01:12 +01:00
Wolfram Sang 4a890148df Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-5.6
The main feature is the idle-state rework of the pca954x driver from Biwen Li.
2020-01-29 21:59:20 +01:00
Wolfram Sang 6810df46c4 at24 updates for linux v5.6
- minor maintenance: update the license tag, sort headers
 - move support for the write-protect pin into nvmem core
 - add a reference to the new wp-gpios property in nvmem to at25 bindings
 - add support for regulator and pm_runtime control
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAl4rHlAACgkQEacuoBRx
 13J9Ug//dprb3sJZDiFrktJBVgCJ8+6l88gXwrkTNDGXGnrE3W4YGA12YO8NQPFR
 hGHLegV+LZCSebcxL7iY69UCMMCLQ5cGKUMXfIJqJQfSBV8em1+81DMHSFh0kJPn
 jVgPo4JAqq0JJPuXz7YQnqtJtksSsBVvxbglm7dSXpF61eqnFEO/Xi80IM3uoqSK
 1FMgu+2PweH4CYPL272bgwRLFLGyzQaI8EQhCvzov+ye8Z1ctVXUmjojmtZCanTM
 1XLTBdwNJKd6ogFpD6YGGBBg53mgANDY4P++DxO7yk7QjhyaculbDPDp43KvJcnO
 QR7PswnMT+78KmJOtxsShLMUCoaNe7aSgq+luby0Zdb2KwZY/K9gOUN6XbsqppEY
 qH3pQdzRZ6k8jZL8QWjemZ1g1B4z6qfbR10k0F5yg8bzXDFlpaRja2wFV63YZk6k
 ld9BHfGss/mR7XztfM4/Tb7Cj5asV6jnX4LGWvK4Va1UZE69QeUKTXYVQIc5v/fB
 hCzkYPW496Yoh0i785eJMwJ5PgwhYhXK+b/panMibFwGttIMxKf/sKejLeOxsMTv
 z20awOCCdo1soCcci6YkOrjN1Lj2EViWg/i0oWsV1FxkKUkPzR3fXRrPgSp0zZ7e
 vKIjU3Ej9QQyuMOxguVm2gB9gj6hB7oTBBlgNb1uQ7Zf1f9Z18Q=
 =jh24
 -----END PGP SIGNATURE-----

Merge tag 'at24-updates-for-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-5.6

at24 updates for linux v5.6

- minor maintenance: update the license tag, sort headers
- move support for the write-protect pin into nvmem core
- add a reference to the new wp-gpios property in nvmem to at25 bindings
- add support for regulator and pm_runtime control
2020-01-29 21:56:36 +01:00
Colin Ian King 878508aed4 i2c: xiic: fix indentation issue
There is a statement that is indented one level too deeply, remove
the extraneous tab.

Fixes: b4c119dbc3 ("i2c: xiic: Add timeout to the rx fifo wait loop")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 21:53:51 +01:00
Colin Ian King eca95cd5a3 i2c: parport: fix spelling mistake: "Atmost" -> "At most"
There is a spelling mistake in a module parameter description.
Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-29 21:51:49 +01:00
Bibby Hsieh cd5676db05 misc: eeprom: at24: support pm_runtime control
Although in the most platforms, the power of eeprom are alway
on, some platforms disable the eeprom power in order to meet
low power request. This patch add the pm_runtime ops to control
power to support all platforms.

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
[Bartosz: rebased on top of current at24/for-next]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2020-01-23 12:52:57 +01:00
Bibby Hsieh c6cadc7538 dt-binding: eeprom: at24: add vcc-supply property
In some platforms, they disable the power-supply of eeprom due
to power consumption reduction. This patch add vcc-supply property.

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2020-01-23 12:42:40 +01:00
Krzysztof Kozlowski a009310fad i2c: exynos: Update Kconfig documentation
Update the help text to reflect current support devices:
1. The Exynos high speed I2C driver supports Exynos5 (ARMv7), Exynos5433
   and Exynos7 (both ARMv8) SoCs,
2. The S3C I2C driver supports S3C, S5Pv210 and Exynos{3,4,5} SoCs.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-23 12:15:18 +01:00
Krzysztof Kozlowski 4a2d5f663d i2c: Enable compile testing for more drivers
Some of the I2C bus drivers can be compile tested to increase build
coverage.  This requires also:
1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
   controllers,
2. Adding 'if' conditional to 'default y' so they will not get enabled
   by default on all other architectures,
3. Limiting few compile test options to supported architectures (which
   provide the readsX()/writesX() primitives).

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
[wsa: revert chunk for ZX2967. it needs more preparation]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-23 12:15:11 +01:00
Shubhrajyoti Datta 10b17004a7 i2c: xiic: Fix the clocking across bind unbind
The recommendation is that the set_active should be done
with pm runtime disabled.
Also fix the remove path for clocking.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 21:13:40 +01:00
Venkatesh Yadav Abbarapu c9d059681b i2c: xiic: defer the probe if clock is not found
It's not always the case that clock is already available when i2c
driver get probed at the first time, e.g. the clock is provided by
clock wizard which may be probed after i2c driver. So let's defer
the probe when devm_clk_get() call fails and give it chance to
try later.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 21:13:34 +01:00
Shubhrajyoti Datta b4c119dbc3 i2c: xiic: Add timeout to the rx fifo wait loop
Add timeout to the rx fifo empty wait loop. Also check for the return
value for xiic_reinit and pass it to xiic_start_xfer.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 21:13:28 +01:00
Krzysztof Kozlowski 40b2ec1251 i2c: highlander: Use proper printk format for size_t
size_t should be printed with its own format to be 64-bit friendly and
fix warning when compiling on 64-bit platform (e.g. with COMPILE_TEST):

    drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
    drivers/i2c/busses/i2c-highlander.c:325:22: warning:
        format ‘%d’ expects argument of type ‘int’,
        but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 21:10:46 +01:00
Krzysztof Kozlowski 17b3fe8b04 i2c: pnx: Use proper printk format for resource_size_t
resource_size_t should be printed with its own size-independent format
to fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-pnx.c: In function ‘i2c_pnx_probe’:
    drivers/i2c/busses/i2c-pnx.c:737:47: warning:
        format ‘%x’ expects argument of type ‘unsigned int’,
        but argument 5 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 21:10:40 +01:00
Krzysztof Kozlowski 066e6e805d i2c: pmcmsp: Use proper printk format for resource_size_t
resource_size_t should be printed with its own size-independent format
to fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-pmcmsp.c: In function ‘pmcmsptwi_probe’:
    drivers/i2c/busses/i2c-pmcmsp.c:276:25: warning:
        format ‘%x’ expects argument of type ‘unsigned int’,
        but argument 3 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 21:10:07 +01:00
Wolfram Sang e8d51e9629 docs: i2c: use the new API in 'writing-clients'
i2c_new_device is deprecated, use i2c_new_client_device. Also, align a
paragraph while here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:40:16 +01:00
Wolfram Sang e634a50c9c docs: i2c: use the new API in 'instantiating-devices.rst'
i2c_new_device is deprecated, use i2c_new_client_device.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:40:14 +01:00
Wolfram Sang 5f0155b44e i2c: i2c-core-of: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:40:12 +01:00
Wolfram Sang 87e07437df i2c: i2c-core-base: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:40:08 +01:00
Wolfram Sang 90a3be9b19 i2c: i2c-core-acpi: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:55 +01:00
Wolfram Sang bf255befe7 i2c: xiic: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:47 +01:00
Wolfram Sang 36056290ee i2c: taos-evm: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:41 +01:00
Wolfram Sang f12c529005 i2c: powermac: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:35 +01:00
Wolfram Sang 7de69dbf0d i2c: ocores: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:26 +01:00
Wolfram Sang 7fd0379f86 i2c: nvidia-gpu: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:21 +01:00
Wolfram Sang 41d06630b4 i2c: i801: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:17 +01:00
Wolfram Sang 6b5794abdc i2c: cht-wc: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 20:39:07 +01:00
Krzysztof Kozlowski 49945ef0f9 i2c: stu300: Use proper printk format for iomem pointer
iomem pointers should be printed with pointer format to hide the
actual value and fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-stu300.c: In function ‘stu300_wait_while_busy’:
    drivers/i2c/busses/i2c-stu300.c:446:76: warning:
        cast from pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 18:39:59 +01:00
Dmitry Osipenko b3ec946975 i2c: tegra: Check DMA completion status in addition to left time
It is more robust to check completion status in addition to the left time
in a case of DMA transfer because transfer's completion happens in two
phases [one is ISR, other is tasklet] and thus it is possible that DMA is
completed while I2C completion awaiting times out because of the deferred
notification done by the DMA driver. The DMA completion status becomes
100% actual after DMA synchronization. This fixes spurious DMA timeouts
when system is under load.

Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 18:32:37 +01:00
Dmitry Osipenko 28d98666db i2c: tegra: Always terminate DMA transfer
It is possible that I2C could error out in the middle of DMA transfer and
in this case DMA channel needs to be reset, otherwise a follow up transfer
will fail because DMA channel stays blocked.

Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-01-15 18:32:29 +01:00