aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/muxes (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-08-04Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-4.19Wolfram Sang1-13/+11
Simplify the probe function of the pca954x driver
2018-07-30i2c: mux: pca954x: use helper variable in probeLinus Walleij1-13/+11
This creates a struct device *dev helper variable in probe() which IMO makes the code less cluttered and easier to read. Also rename the of_node veriable to the common shortform "np" (node pointer). Signed-off-by: Linus Walleij <linus.walleij@linaro.org> [peda: slightly edited commit message and removed some surplus newlines] Signed-off-by: Peter Rosin <peda@axentia.se>
2018-07-13Merge branch 'i2c/precise-locking-names_immutable' into i2c/for-4.19Wolfram Sang1-3/+3
2018-07-13i2c: mux: pca9541: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)Peter Rosin1-3/+3
Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: mux: pca954x: make use of __i2c_smbus_xferPeter Rosin1-23/+4
This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: mux: pca9541: make use of __i2c_smbus_xferPeter Rosin1-58/+11
This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: mux: mlxcpld: make use of __i2c_smbus_xferPeter Rosin1-24/+4
This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin <peda@axentia.se> Acked-by: Michael Shych <michaelsh@mellanox.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-06-14Merge branch 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds5-16/+20
Pull i2c updates from Wolfram Sang: - mainly feature additions to drivers (stm32f7, qup, xlp9xx, mlxcpld, ...) - conversion to use the i2c_8bit_addr_from_msg macro consistently - move includes to platform_data - core updates to allow the (still in review) I3C subsystem to connect - and the regular share of smaller driver updates * 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (68 commits) i2c: qup: fix building without CONFIG_ACPI i2c: tegra: Remove suspend-resume i2c: imx-lpi2c: Switch to SPDX identifier i2c: mxs: Switch to SPDX identifier i2c: busses: make use of i2c_8bit_addr_from_msg i2c: algos: make use of i2c_8bit_addr_from_msg i2c: rcar: document R8A77980 bindings i2c: qup: Add command-line parameter to override SCL frequency i2c: qup: Correct duty cycle for FM and FM+ i2c: qup: Add support for Fast Mode Plus i2c: qup: add probe path for Centriq ACPI devices i2c: robotfuzz-osif: drop pointless test i2c: robotfuzz-osif: remove pointless local variable i2c: rk3x: Don't print visible virtual mapping MMIO address i2c: opal: don't check number of messages in the driver i2c: ibm_iic: don't check number of messages in the driver i2c: imx: Switch to SPDX identifier i2c: mux: pca954x: merge calls to of_match_device and of_device_get_match_data i2c: mux: demux-pinctrl: use proper parent device for demux adapter i2c: mux: improve error message for failed symlink ...
2018-06-12treewide: devm_kzalloc() -> devm_kcalloc()Kees Cook2-6/+7
The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc(). This patch replaces cases of: devm_kzalloc(handle, a * b, gfp) with: devm_kcalloc(handle, a * b, gfp) as well as handling cases of: devm_kzalloc(handle, a * b * c, gfp) with: devm_kzalloc(handle, array3_size(a, b, c), gfp) as it's slightly less ugly than: devm_kcalloc(handle, array_size(a, b), c, gfp) This does, however, attempt to ignore constant size factors like: devm_kzalloc(handle, 4 * 1024, gfp) though any constants defined via macros get caught up in the conversion. Any factors with a sizeof() of "unsigned char", "char", and "u8" were dropped, since they're redundant. Some manual whitespace fixes were needed in this patch, as Coccinelle really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...". The Coccinelle script used for this was: // Fix redundant parens around sizeof(). @@ expression HANDLE; type TYPE; expression THING, E; @@ ( devm_kzalloc(HANDLE, - (sizeof(TYPE)) * E + sizeof(TYPE) * E , ...) | devm_kzalloc(HANDLE, - (sizeof(THING)) * E + sizeof(THING) * E , ...) ) // Drop single-byte sizes and redundant parens. @@ expression HANDLE; expression COUNT; typedef u8; typedef __u8; @@ ( devm_kzalloc(HANDLE, - sizeof(u8) * (COUNT) + COUNT , ...) | devm_kzalloc(HANDLE, - sizeof(__u8) * (COUNT) + COUNT , ...) | devm_kzalloc(HANDLE, - sizeof(char) * (COUNT) + COUNT , ...) | devm_kzalloc(HANDLE, - sizeof(unsigned char) * (COUNT) + COUNT , ...) | devm_kzalloc(HANDLE, - sizeof(u8) * COUNT + COUNT , ...) | devm_kzalloc(HANDLE, - sizeof(__u8) * COUNT + COUNT , ...) | devm_kzalloc(HANDLE, - sizeof(char) * COUNT + COUNT , ...) | devm_kzalloc(HANDLE, - sizeof(unsigned char) * COUNT + COUNT , ...) ) // 2-factor product with sizeof(type/expression) and identifier or constant. @@ expression HANDLE; type TYPE; expression THING; identifier COUNT_ID; constant COUNT_CONST; @@ ( - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(TYPE) * (COUNT_ID) + COUNT_ID, sizeof(TYPE) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(TYPE) * COUNT_ID + COUNT_ID, sizeof(TYPE) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(TYPE) * (COUNT_CONST) + COUNT_CONST, sizeof(TYPE) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(TYPE) * COUNT_CONST + COUNT_CONST, sizeof(TYPE) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(THING) * (COUNT_ID) + COUNT_ID, sizeof(THING) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(THING) * COUNT_ID + COUNT_ID, sizeof(THING) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(THING) * (COUNT_CONST) + COUNT_CONST, sizeof(THING) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(THING) * COUNT_CONST + COUNT_CONST, sizeof(THING) , ...) ) // 2-factor product, only identifiers. @@ expression HANDLE; identifier SIZE, COUNT; @@ - devm_kzalloc + devm_kcalloc (HANDLE, - SIZE * COUNT + COUNT, SIZE , ...) // 3-factor product with 1 sizeof(type) or sizeof(expression), with // redundant parens removed. @@ expression HANDLE; expression THING; identifier STRIDE, COUNT; type TYPE; @@ ( devm_kzalloc(HANDLE, - sizeof(TYPE) * (COUNT) * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | devm_kzalloc(HANDLE, - sizeof(TYPE) * (COUNT) * STRIDE + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | devm_kzalloc(HANDLE, - sizeof(TYPE) * COUNT * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | devm_kzalloc(HANDLE, - sizeof(TYPE) * COUNT * STRIDE + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | devm_kzalloc(HANDLE, - sizeof(THING) * (COUNT) * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | devm_kzalloc(HANDLE, - sizeof(THING) * (COUNT) * STRIDE + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | devm_kzalloc(HANDLE, - sizeof(THING) * COUNT * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | devm_kzalloc(HANDLE, - sizeof(THING) * COUNT * STRIDE + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) ) // 3-factor product with 2 sizeof(variable), with redundant parens removed. @@ expression HANDLE; expression THING1, THING2; identifier COUNT; type TYPE1, TYPE2; @@ ( devm_kzalloc(HANDLE, - sizeof(TYPE1) * sizeof(TYPE2) * COUNT + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) , ...) | devm_kzalloc(HANDLE, - sizeof(TYPE1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) , ...) | devm_kzalloc(HANDLE, - sizeof(THING1) * sizeof(THING2) * COUNT + array3_size(COUNT, sizeof(THING1), sizeof(THING2)) , ...) | devm_kzalloc(HANDLE, - sizeof(THING1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(THING1), sizeof(THING2)) , ...) | devm_kzalloc(HANDLE, - sizeof(TYPE1) * sizeof(THING2) * COUNT + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) , ...) | devm_kzalloc(HANDLE, - sizeof(TYPE1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) , ...) ) // 3-factor product, only identifiers, with redundant parens removed. @@ expression HANDLE; identifier STRIDE, SIZE, COUNT; @@ ( devm_kzalloc(HANDLE, - (COUNT) * STRIDE * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | devm_kzalloc(HANDLE, - COUNT * (STRIDE) * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | devm_kzalloc(HANDLE, - COUNT * STRIDE * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | devm_kzalloc(HANDLE, - (COUNT) * (STRIDE) * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | devm_kzalloc(HANDLE, - COUNT * (STRIDE) * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | devm_kzalloc(HANDLE, - (COUNT) * STRIDE * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | devm_kzalloc(HANDLE, - (COUNT) * (STRIDE) * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | devm_kzalloc(HANDLE, - COUNT * STRIDE * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) ) // Any remaining multi-factor products, first at least 3-factor products, // when they're not all constants... @@ expression HANDLE; expression E1, E2, E3; constant C1, C2, C3; @@ ( devm_kzalloc(HANDLE, C1 * C2 * C3, ...) | devm_kzalloc(HANDLE, - (E1) * E2 * E3 + array3_size(E1, E2, E3) , ...) | devm_kzalloc(HANDLE, - (E1) * (E2) * E3 + array3_size(E1, E2, E3) , ...) | devm_kzalloc(HANDLE, - (E1) * (E2) * (E3) + array3_size(E1, E2, E3) , ...) | devm_kzalloc(HANDLE, - E1 * E2 * E3 + array3_size(E1, E2, E3) , ...) ) // And then all remaining 2 factors products when they're not all constants, // keeping sizeof() as the second factor argument. @@ expression HANDLE; expression THING, E1, E2; type TYPE; constant C1, C2, C3; @@ ( devm_kzalloc(HANDLE, sizeof(THING) * C2, ...) | devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...) | devm_kzalloc(HANDLE, C1 * C2 * C3, ...) | devm_kzalloc(HANDLE, C1 * C2, ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(TYPE) * (E2) + E2, sizeof(TYPE) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(TYPE) * E2 + E2, sizeof(TYPE) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(THING) * (E2) + E2, sizeof(THING) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - sizeof(THING) * E2 + E2, sizeof(THING) , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - (E1) * E2 + E1, E2 , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - (E1) * (E2) + E1, E2 , ...) | - devm_kzalloc + devm_kcalloc (HANDLE, - E1 * E2 + E1, E2 , ...) ) Signed-off-by: Kees Cook <keescook@chromium.org>
2018-05-30Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-4.18Wolfram Sang4-15/+19
This time around we have mostly trivial changes. However, there are also a couple of "real" patches improving a few aspects of the demux-pinctrl behavior and we also actually reset pca954x chips on probe when we have the ability to do so.
2018-05-24i2c: mux: pca954x: merge calls to of_match_device and of_device_get_match_dataJulia Lawall1-5/+2
Drop call to of_match_device, which is subsumed by the subsequent call to of_device_get_match_data. The code becomes simpler, and a temporary variable can be dropped. The semantic match that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ local idexpression match; identifier i; expression x, dev, e, e1; @@ - match@i = of_match_device(x, dev); - if (match) e = of_device_get_match_data(dev); - else e = e1; + e = of_device_get_match_data(dev); + if (!e) e = e1; @@ identifier r.i; @@ - const struct of_device_id *i; ... when != i // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Peter Rosin <peda@axentia.se>
2018-05-24i2c: mux: demux-pinctrl: use proper parent device for demux adapterWolfram Sang1-1/+1
Due to a typo, the wrong parent device was assigned to the newly created demuxing adapter device. It got connected to the demuxing platform device but not to the selected parent I2C adapter device. Fix it to get a proper parent-child relationship of the demuxed busses. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Peter Rosin <peda@axentia.se>
2018-05-24i2c: mux: reg: failed memory allocation is logged elsewhereMarkus Elfring1-3/+1
Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2018-05-19i2c: mux: pca954x: force reset on probe if availableMike Looijmans1-2/+9
Instead of just hogging the reset GPIO into deactivated state, activate and then de-activate the reset. This allows for better recovery if the CPU was reset halfway through an I2C transaction for example. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Peter Rosin <peda@axentia.se>
2018-05-19i2c: mux: demux-pinctrl: disable PM user interfaceWolfram Sang1-0/+3
The demux device is only a logical device with no children. So, no RuntimePM is needed, let's disable the sysfs interface for it. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2018-05-19i2c: mux: ltc4306: switch to using .probe_newPeter Rosin1-4/+3
Use the new probe style for i2c drivers. Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2018-05-17i2c: mux: gpio: move header to platform_dataWolfram Sang1-1/+1
This header only contains platform_data. Move it to the proper directory. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Peter Korsgaard <peter.korsgaard@barco.com>
2018-03-06i2c: mux: pca954x: verify the device id of the pca984x chipsPeter Rosin1-6/+49
Make sure to not disallow the chips on adapters that are not capable of reading the device id, but also make sure to check the device id before writing to the chip. Tested-by: Adrian Fiergolski <adrian.fiergolski@cern.ch> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-12-30i2c: mux: reg: don't log an error for probe deferralTomasz Bachorski1-0/+3
It's possible that i2c_mux_reg_probe_dt() could return -EPROBE_DEFER. In that case, driver will request a probe deferral and an error suggesting device tree parsing problem will be reported. This is a pretty confusing information. Let's change the error handling, so driver will be able to request probe deferral without logging not related errors. Signed-off-by: Tomasz Bachorski <tomasz.bachorski@nokia.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-12-30i2c: mux: pca954x: add support for NXP PCA984x familyAdrian Fiergolski2-7/+37
This patch extends the current i2c-mux-pca954x driver and adds support for a newer PCA984x family of the I2C switches and multiplexers from NXP. Signed-off-by: Adrian Fiergolski <adrian.fiergolski@cern.ch> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-11-14Merge branch 'i2c/for-4.15' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds2-69/+35
Pull i2c updates from Wolfram Sang: "This contains two bigger than usual tree-wide changes this time. They all have proper acks, caused no merge conflicts in linux-next where they have been for a while. They are namely: - to-gpiod conversion of the i2c-gpio driver and its users (touching arch/* and drivers/mfd/*) - adding a sbs-manager based on I2C core updates to SMBus alerts (touching drivers/power/*) Other notable changes: - i2c_boardinfo can now carry a dev_name to be used when the device is created. This is because some devices in ACPI world need fixed names to find the regulators. - the designware driver got a long discussed overhaul of its PM handling. img-scb and davinci got PM support, too. - at24 driver has way better OF support. And it has a new maintainer. Thanks Bartosz for stepping up! The rest is regular driver updates and fixes" * 'i2c/for-4.15' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (55 commits) ARM: sa1100: simpad: Correct I2C GPIO offsets i2c: aspeed: Deassert reset in probe eeprom: at24: Add OF device ID table MAINTAINERS: new maintainer for AT24 driver i2c: nuc900: remove platform_data, too i2c: thunderx: Remove duplicate NULL check i2c: taos-evm: Remove duplicate NULL check i2c: Make i2c_unregister_device() NULL-aware i2c: xgene-slimpro: Support v2 i2c: mpc: remove useless variable initialization i2c: omap: Trigger bus recovery in lockup case i2c: gpio: Add support for named gpios in DT dt-bindings: i2c: i2c-gpio: Add support for named gpios i2c: gpio: Local vars in probe i2c: gpio: Augment all boardfiles to use open drain i2c: gpio: Enforce open drain through gpiolib gpio: Make it possible for consumers to enforce open drain i2c: gpio: Convert to use descriptors power: supply: sbs-message: fix some code style issues power: supply: sbs-battery: remove unchecked return var ...
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman1-0/+1
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01Merge branch 'i2c/sbs-manager' into i2c/for-4.15Wolfram Sang1-63/+32
2017-10-28i2c: mux: pca954x: Return error if irq_create_mapping failsPhil Reid1-0/+4
irq_create_mapping can return an error, report error to log and return. Cleanup will occur in the probe function when an error is returned. Suggested-by: Peter Rosin <peda@axentia.se> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-10-28i2c: mux: pca954x: call request irq after adding mux segmentsPhil Reid1-63/+28
The pca954x device do not have the ability to mask interrupts. For i2c slave devices that also don't have masking ability (eg ltc1760 smbalert output) delay registering the irq until after the mux segments have been configured. During the mux add_adaptor call the core i2c system can register an smbalert handler which would then be called immediately when the irq is registered. This smbalert handler will then clear the pending irq. This removes the need for the irq_mask / irq_unmask calls that were original used to do this. Signed-off-by: Phil Reid <preid@electromag.com.au> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-10-20i2c: mux: reg: use of_property_read_bool()Sergei Shtylyov1-6/+3
Use more compact of_property_read_bool() calls for the boolean properties instead of of_find_property() calls in i2c_mux_reg_probe_dt(). Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-09-09Merge branch 'i2c/for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds6-163/+82
Pull i2c updates from Wolfram Sang: - new drivers for Spreadtrum I2C, Intel Cherry Trail Whiskey Cove SMBUS - quite some driver updates - cleanups for the i2c-mux subsystem - some subsystem-wide constification - further cleanup of include/linux/i2c * 'i2c/for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (50 commits) i2c: sprd: Fix undefined reference errors i2c: nomadik: constify amba_id i2c: versatile: Make i2c_algo_bit_data const i2c: busses: make i2c_adapter_quirks const i2c: busses: make i2c_adapter const i2c: busses: make i2c_algorithm const i2c: Add Spreadtrum I2C controller driver dt-bindings: i2c: Add Spreadtrum I2C controller documentation i2c-cht-wc: make cht_wc_i2c_adap_driver static MAINTAINERS: Add entry for drivers/i2c/busses/i2c-cht-wc.c i2c: aspeed: Retain delay/setup/hold values when configuring bus frequency dt-bindings: i2c: eeprom: Document vendor to be used and deprecated ones i2c: i801: Restore the presence state of P2SB PCI device after reading BAR MAINTAINERS: drop entry for Blackfin I2C and Sonic's email blackfin: merge the two TWI header files i2c: davinci: Preserve return value of devm_clk_get i2c: mediatek: Add i2c compatible for MediaTek MT7622 dt-bindings: i2c: Add MediaTek MT7622 i2c binding dt-bindings: i2c: modify information formats i2c: mux: i2c-arb-gpio-challenge: allow compiling w/o OF support ...
2017-08-27Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-4.14Wolfram Sang5-161/+80
2017-08-22i2c: mux: i2c-arb-gpio-challenge: allow compiling w/o OF supportPeter Rosin1-1/+1
It simplifies some tests. Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-17i2c: mux: pinctrl: potential NULL dereference on errorDan Carpenter1-1/+1
If i2c_mux_alloc() fails then we'd have a NULL dereference here. Fixes: c4aee3e1b0de ("i2c: mux: pinctrl: remove platform_data") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: pinctrl: drop the idle_state memberPeter Rosin1-6/+2
The information is available elsewhere. Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: pinctrl: remove platform_dataPeter Rosin2-148/+72
No platform (at least no upstreamed platform) has ever used this platform_data. Just drop it and simplify the code. Reviewed-by: Stephen Warren <swarren@nvidia.com> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: mlxcpld: move header file out of I2C realmWolfram Sang1-1/+1
include/linux/i2c is not for client devices. Move the header file to a more appropriate location. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: pca954x: move header file out of I2C realmWolfram Sang2-2/+2
include/linux/i2c is not for client devices. Move the header file to a more appropriate location. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: pca9541: sort include filesWolfram Sang1-4/+3
Make it consistent with the other drivers. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-07-31i2c: Convert to using %pOF instead of full_nameRob Herring1-2/+2
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-17i2c: mux: pinctrl: mention correct module name in Kconfig help textChris Gorman1-1/+1
Kconfig says the resulting module is pinctrl-i2cmux, but the module when built is i2c-mux-pinctrl. Fixes: ae58d1e40698 ("i2c: Add generic I2C multiplexer using pinctrl API") Signed-off-by: Chris Gorman <chrisjohgorman@gmail.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-06-03i2c: i2c-mux-gpmux: new driverPeter Rosin3-0/+187
This is a general purpose i2c mux that uses a multiplexer controlled by the multiplexer subsystem to do the muxing. The user can select if the mux is to be mux-locked and parent-locked as described in Documentation/i2c/i2c-topology. Acked-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15i2c: mux: reg: rename label to indicate what it doesPeter Rosin1-2/+2
That maintains sanity if it is ever called from some other spot, and also makes the label names coherent. Signed-off-by: Peter Rosin <peda@axentia.se>
2017-05-15i2c: mux: reg: put away the parent i2c adapter on probe failurePeter Rosin1-5/+12
It is only prudent to let go of resources that are not used. Fixes: b3fdd32799d8 ("i2c: mux: Add register-based mux i2c-mux-reg") Signed-off-by: Peter Rosin <peda@axentia.se>
2017-05-03Merge branch 'i2c/for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds9-27/+346
Pull i2c updates from Wilfram Sang: "I2C has the following updates for you: - an immutable cross-subsystem branch fixing PMIC access on Intel Baytrail - bigger driver updates to the designware, meson, exynos5 drivers - new i2c_acpi_new_device() function to create devices from ACPI - struct i2c_driver has now a flag 'disable_i2c_core_irq_mapping' to allow custom IRQ mapping in case the default does not fit - mux subsystem centralized error messages in its core - new driver for ltc4306 i2c mux - usual set of small updates" * 'i2c/for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (44 commits) i2c: thunderx: Enable HWMON class probing i2c: rcar: clarify PM handling with more comments i2c: rcar: fix resume by always initializing registers before transfer i2c: tegra: fix spelling mistake: "contoller" -> "controller" i2c: exynos5: use core helper to get driver data i2c: exynos5: de-duplicate error logs on clock setup i2c: exynos5: simplify clock frequency handling i2c: exynos5: simplify timings calculation i2c: designware-baytrail: fix potential null pointer dereference on dev i2c: designware: Get selected speed mode sda-hold-time via ACPI [media] cx231xx: stop double error reporting i2c: core: Allow drivers to disable i2c-core irq mapping i2c: core: Add new i2c_acpi_new_device helper function i2c: core: Allow getting ACPI info by index i2c: img-scb: use setup_timer i2c: i2c-scmi: add a MS HID i2c: mux: ltc4306: LTC4306 and LTC4305 I2C multiplexer/switch dt-bindings: i2c: mux: ltc4306: Add dt-bindings for I2C multiplexer/switch i2c: mux: reg: stop double error reporting i2c: mux: pinctrl: stop double error reporting ...
2017-04-12i2c: mux: ltc4306: LTC4306 and LTC4305 I2C multiplexer/switchMichael Hennerich3-0/+334
This patch adds support for the Analog Devices / Linear Technology LTC4306 and LTC4305 4/2 Channel I2C Bus Multiplexer/Switches. The LTC4306 optionally provides two general purpose input/output pins (GPIOs) that can be configured as logic inputs, opendrain outputs or push-pull outputs via the generic GPIOLIB framework. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-04-03i2c: mux: reg: stop double error reportingPeter Rosin1-3/+1
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-04-03i2c: mux: pinctrl: stop double error reportingPeter Rosin1-3/+1
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-04-03i2c: mux: pca954x: stop double error reportingPeter Rosin1-6/+1
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-04-03i2c: mux: pca9541: stop double error reportingPeter Rosin1-3/+1
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-04-03i2c: mux: gpio: stop double error reportingPeter Rosin1-3/+1
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-04-03i2c: arb: gpio-challenge: stop double error reportingPeter Rosin1-3/+1
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-03-24i2c: mux: pca954x: Add missing pca9546 definition to chip_descMike Looijmans1-1/+5
The spec for the pca9546 was missing. This chip is the same as the pca9545 except that it lacks interrupt lines. While the i2c_device_id table mapped the pca9546 to the pca9545 definition the compatible table did not. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-03-23Revert "i2c: mux: pca954x: Add ACPI support for pca954x"Andy Shevchenko1-27/+1
In ACPI world any ID should be carefully chosen and registered officially. The commit bbf9d262a147 seems did a wrong assumption because PCA is the registered PNP ID for "PHILIPS BU ADD ON CARD". I'm pretty sure this prefix has nothing to do with the driver in question. Moreover, newer ACPI specification has a support of _DSD method and special device IDs to allow drivers be enumerated via compatible string. The slight change to support this kind of enumeration will be added in sequential patch against pca954x.c. Revert the commit bbf9d262a147 for good. Cc: Tin Huynh <tnhuynh@apm.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Peter Rosin <peda@axentia.se>