summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
...
| * i2c: cadence: set THIS_MODULE to the owner of the adapterMasahiro Yamada2015-08-101-0/+1
| | | | | | | | | | | | | | The owner of the adapter is missing, while this driver is tristate. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Make debug print in i2c_dw_isr() shorterJarkko Nikula2015-08-101-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | Printing adapter name is irrelevant from this debug print and makes output needlessly long. Having already device and functions names printed here is enough for debugging. While at it remove extra space from "enabled= 0x" and use "%#x" for printing "0x" prefixed hexadecimal values. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> [wsa: made it a oneliner] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: arb-gpio-challenge: use of_get_i2c_adapter_by_node interfaceVladimir Zapolskiy2015-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | This change is needed to properly lock I2C parent bus driver. Prior to this change i2c_put_adapter() is misused, which may lead to an overflow over zero of I2C bus driver user counter. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: core: add and export of_get_i2c_adapter_by_node() interfaceVladimir Zapolskiy2015-08-101-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_find_i2c_adapter_by_node() call requires quite often missing put_device(), and i2c_put_adapter() releases a device locked by i2c_get_adapter() only. In general module_put(adapter->owner) and put_device(dev) are not interchangeable. This is a common error reproduction scenario as a result of the misusage described above (for clearness this is run on iMX6 platform with HDMI and I2C bus drivers compiled as kernel modules): root@mx6q:~# lsmod | grep i2c i2c_imx 10213 0 root@mx6q:~# lsmod | grep dw_hdmi_imx dw_hdmi_imx 3631 0 dw_hdmi 11846 1 dw_hdmi_imx imxdrm 8674 3 dw_hdmi_imx,imx_ipuv3_crtc,imx_ldb drm_kms_helper 113765 5 dw_hdmi,imxdrm,imx_ipuv3_crtc,imx_ldb root@mx6q:~# rmmod dw_hdmi_imx root@mx6q:~# lsmod | grep i2c i2c_imx 10213 -1 ^^^^^ root@mx6q:~# rmmod i2c_imx rmmod: ERROR: Module i2c_imx is in use To fix existing users of these interfaces and to avoid any further confusion and misusage in future, add one more interface of_get_i2c_adapter_by_node(), it is similar to i2c_get_adapter() in sense that an I2C bus device driver found and locked by user can be correctly unlocked by i2c_put_adapter(). Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: core: manage i2c bus device refcount in i2c_[get|put]_adapterVladimir Zapolskiy2015-08-101-3/+12
| | | | | | | | | | | | | | | | | | | | In addition to module_get()/module_put() add get_device()/put_device() calls into i2c_get_adapter()/i2c_put_adapter() exported interfaces. This is done to lock I2C bus device, if it is in use by a client. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-08-103-3/+0Star
| | | | | | | | | | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware-pci: use IRQF_COND_SUSPEND flagAndy Shevchenko2015-08-101-2/+2
| | | | | | | | | | | | | | | | | | The mentioned flag fixes a warning on Intel Edison board since one of the I2C controller shares IRQ line with watchdog timer. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: parport: Add VCT-jig adapterOndrej Zary2015-08-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | Add support for VCT-jig parallel port I2C adapter to i2c-parport. The adapter schematic can be found here (in the RAR file): http://remont-aud.net/shop/22/desc/vct-jig-komplekt-dlja-samostojatelnoj-sborki Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: removed work arounds in i2c driver for Zynq Ultrascale+ MPSoCAnurag Kumar Vulisha2015-08-101-11/+57
| | | | | | | | | | | | | | | | | | Cadence 1.0 version has bugs which have been fixed in the cadence 1.4 version. This patch removes the quirks present in the driver for cadence 1.4 version. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> [wsa: fixed indentation issues in r1p10_i2c_def] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: tegra: add support for fast plus (FM+) mode clock rateLaxman Dewangan2015-08-101-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tegra I2C controller required to configure the clock divisor register inside controller to different value based on the clock speed. The recommended clock divisor for the I2C controller for standard/fast mode is 0x19 and for fast-mode plus is 0x10. Add support to configure clock divisor register of I2C controller based on bus clock rate. This clock divisor is supported form T114 onwards. Signed-off-by: Chaitanya Bandi <bandik@nvidia.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: tegra: update CONFIG_LOAD for new conifigurationLaxman Dewangan2015-08-101-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once the new configuration is set on the conifg register of I2C controller, it is require to update the CONFIG_LOAD register to transfer the new SW configuration to actual HW internal registers that would be used in the actual logic. It is like, SW is programming only shadow registers through regular configuration and when these load_config bit fields are set to 1, it causes the regular/shadows registers configuration transferred to the HW internal active registers. So SW has to set these bit fields at the end of all regular registers configuration. And these config_load bits are HW auto-clear bits. HW clears these bit fields once the register configuration is moved to HW internal active registers. So SW has to wait until these bits are auto-cleared before going for any further programming This mechanism is supported on T124 and after this SoCs. Signed-off-by: Chaitanya Bandi <bandik@nvidia.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: omap: fix cleanup regressionWolfram Sang2015-08-101-1/+1
| | | | | | | | | | | | | | | | | | Patch "i2c: omap: abolish variable name confusion" triggered a coccinelle warning which we fix here: drivers/i2c/busses/i2c-omap.c:1333:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1334 Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: Do not continue in case of errors in RxShubhrajyoti Datta2015-08-101-0/+2
| | | | | | | | | | | | | | | | | | | | In case of error conditions like Arbitration lost or NACK lets signal the waiting process. Handle error cases in the Rx path Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: Service all interrupts in isrShubhrajyoti Datta2015-08-101-14/+10Star
| | | | | | | | | | | | | | | | | | Currently only one interrupt is serviced in the isr. In case the multiple interrupts happen simultenously we service and ack only one of them. Check for all the causes in the isr and service them. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: Remove the Addressed as slave interruptShubhrajyoti Datta2015-08-101-1/+1
| | | | | | | | | | | | | | | | | | Currently there is no slave mode support in the driver also in the isr we just ack it and do nothing. So disable the AAS interrupt. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: Remove busy loop while waiting for bus busyShubhrajyoti Datta2015-08-101-1/+1
| | | | | | | | | | | | | | | | Remove the busy loop while waiting for bus busy. Instead let the processor sleep. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: Remove the disabling of interruptsShubhrajyoti Datta2015-08-101-7/+0Star
| | | | | | | | | | | | | | | | | | | | | | Currently before every transfer the interrupts are disabled. So incase the slave nacks in the middle of the transfer the current transfer is not aborted. Upon enabling the interrupts conditions like NACK , arbitration lost will not be masked. Remove the disabling of the interrupts. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: Do not reset controller before every transferShubhrajyoti Datta2015-08-101-1/+0Star
| | | | | | | | | | | | | | | | | | | | Currently before every transfer the controller is reinitialised. We are already resetting the controller upon errors so upon every transfer is a performance kill. Remove the same. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: move the xiic_process to thread contextShubhrajyoti Datta2015-08-101-13/+20
| | | | | | | | | | | | | | | | | | | | The xiic_process is a 154 line code that runs in isr context currently move it to thread context. Also the name xiic_process suggests that the intension was to run in process context. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> [wsa: initialized irqreturn_t to IRQ_NONE instead of IRQ_HANDLED] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: xiic: Remove the disabling of interruptsShubhrajyoti Datta2015-08-101-3/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | Currently the interrupts are disabled at the start of the isr and enabled at the end of the isr. Remove the same. In case the slave device NACKs the transaction while in the isr the transfer will continue and the NACK interrupt will arrive only after the isr is serviced. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pxa: Use devm_ variants in probe functionVaibhav Hiremath2015-08-101-51/+26Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up i2c_pxa_probe() function, - Use devm_ variants wherever This will clean both probe exit and i2c_pxa_remove() functions - Check platform resource before parsing any other data from DT/platform - Use dev_err on failure from i2c_add_numbered_adapter() - Use pr_info instead of printk for KERN_INFO Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> [wsa: removed unneeded error prinout after devm_ioremap_resource] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pxa: Update debug function to dump more info on errorVaibhav Hiremath2015-08-101-7/+15
| | | | | | | | | | | | | | | | | | | | | | Update i2c_pxa_scream_blue_murder() fn to print more information in case of error. Also, use dev_err variants instead of printk. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Cc: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pxa: Fix compile warning in 64bit modeYipeng Yao2015-08-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix below warning message, coming from 64 bit toolchain. drivers/i2c/busses/i2c-pxa.c:1237:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Yipeng Yao <ypyao@marvell.com> [vaibhav.hiremath@linaro.org: Updated Changelog] Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Cc: Wolfram Sang <wsa@the-dreams.de> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pxa: Return I2C_RETRY when timeout in pio modeShouming Wang2015-08-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | In case of timeout in pio mode of operation return I2C_RETRY. This behavior will be same as interrupt mode of operation. Signed-off-by: Shouming Wang <wangshm@marvell.com> [vaibhav.hiremath@linaro.org: Updated changelog] Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pxa: No need to set slave addr for i2c master mode resetVaibhav Hiremath2015-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally i2c controller works as master, so slave addr is not needed, or it will impact some slave device (eg. ST NFC chip) i2c accesses, because it has the same i2c address with controller. For example, On the pxa1928 based platform, where PMIC (88pm860) is present @0x30 address on TWSI0 interface, and if we set 0x30 as a slave address in pxa1928 TWSI0 module, all the transactions towards PMIC would go for toss. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pxa: keep i2c irq ON in suspendLeilei Shang2015-08-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | During suspend there may still be some i2c access happening, as the interrupt is shared between multiple drivers. And if we don't keep i2c irq ON, there may be i2c access timeout if i2c is in irq mode of operation. Signed-off-by: Raul Xiong <xjian@marvell.com> Signed-off-by: Xiaofan Tian <tianxf@marvell.com> [vaibhav.hiremath@linaro.org: updated Changelog] Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Cc: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: emev2: add driverWolfram Sang2015-08-103-0/+340
| | | | | | | | | | | | | | | | | | | | | | Add a basic driver for the Renesas EMEV2 SoC. Based on the driver from the BSP which was first worked on by Ian, and made ready for upstream by me. Signed-off-by: Ian Molton <ian.molton@codethink.co.uk> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: omap: on ->remove() call pm_runtime_put_sync()Felipe Balbi2015-08-101-1/+1
| | | | | | | | | | | | | | | | | | we're about to remove the module, so we can't really schedule a PM transition in the future, we must wait for it to finish. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: omap: abolish variable name confusionFelipe Balbi2015-08-101-299/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | struct device pointers are usually called dev. Calling our struct omap_i2c_dev pointers also dev has caused enough confusion. This is the result of a few simple sed rules to convert all struct omap_i2c_dev pointers to be called omap instead. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: omap: switch to dev_get_drvdata()Felipe Balbi2015-08-101-4/+2Star
| | | | | | | | | | | | | | | | | | | | | | there's no need to fetch the platform_device in order to dereference it back to the dev pointer to access drvdata, we can use dev_get_drvdata() instead. Signed-off-by: Felipe Balbi <balbi@ti.com> Acked-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: parport: start using pr_fmtSudip Mukherjee2015-08-101-8/+8
| | | | | | | | | | | | | | | | | | Start using pr_fmt and convert all remaining printk to use pr_* family of macros. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> [wsa: remove print on kzalloc failure] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: parport: use dev_*Sudip Mukherjee2015-08-101-4/+5
| | | | | | | | | | | | | | Now parport is using device model so use dev_* macros instead of printk. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | Merge tag 'mfd-for-linus-4.3' of ↵Linus Torvalds2015-09-041-1/+119
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Device Support: - New Clocksource driver from ST - New MFD/ACPI/DMA drivers for Intel's Sunrisepoint PCH based platforms - Add support for Arizona WM8998 and WM1814 - Add support for Dialog Semi DA9062 and DA9063 - Add support for Kontron COMe-bBL6 and COMe-cBW6 - Add support for X-Powers AXP152 - Add support for Atmel, many - Add support for STMPE, many - Add support for USB in X-Powers AXP22X Core Frameworks: - New Base API to traverse devices and their children in reverse order Bug Fixes: - Fix race between runtime-suspend and IRQs - Obtain platform data form more reliable source Fix-ups: - Constifying things - Variable signage changes - Kconfig depends|selects changes - Make use of BIT() macro - Do not supply .owner attribute in *_driver structures - MAINTAINERS entries - Stop using set_irq_flags() - Start using irq_set_chained_handler_and_data() - Export DT device ID structures" * tag 'mfd-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (69 commits) mfd: jz4740-adc: Init mask cache in generic IRQ chip mfd: cros_ec: spi: Add OF match table mfd: stmpe: Add OF match table mfd: max77686: Split out regulator part from the DT binding mfd: Add DT binding for Maxim MAX77802 IC mfd: max77686: Use a generic name for the PMIC node in the example mfd: max77686: Don't suggest in binding to use a deprecated property mfd: Add MFD_CROS_EC dependencies mfd: cros_ec: Remove CROS_EC_PROTO dependency for SPI and I2C drivers mfd: axp20x: Add a cell for the usb power_supply part of the axp20x PMICs mfd: axp20x: Add missing registers, and mark more registers volatile mfd: arizona: Fixup some formatting/white space errors mfd: wm8994: Fix NULL pointer exception on missing pdata of: Add vendor prefix for Nuvoton mfd: mt6397: Implement wake handler and suspend/resume to handle wake up event mfd: atmel-hlcdc: Add support for new SoCs mfd: Export OF module alias information in missing drivers mfd: stw481x: Export I2C module alias information mfd: da9062: Support for the DA9063 OnKey in the DA9062 core mfd: max899x: Avoid redundant irq_data lookup ...
| * i2c: i801: Create iTCO device on newer Intel PCHsMika Westerberg2015-08-111-1/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. In order to support the iTCO watchdog on newer PCHs we need to create the platform device here in the SMBus driver and pass all known resources using platform data. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | i2c: fix leaked device refcount on of_find_i2c_* error pathVladimir Zapolskiy2015-08-011-6/+14
| | | | | | | | | | | | | | | | | | If of_find_i2c_device_by_node() or of_find_i2c_adapter_by_node() find a device by node, but its type does not match, a reference to that device is still held. This change fixes the problem. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | i2c: Fix typo in i2c-bfin-twi.cMasanari Iida2015-07-311-2/+2
| | | | | | | | | | | | | | | | | | This patch fix some typos found in a printk message and MODULE_DESCRIPTION. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | i2c: omap: fix bus recovery setupJan Luebbe2015-07-311-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to allow direct access to the SCL and SDA pins. In addition to ST_EN, we need to set the TMODE to 0b11 (Loop back & SDA/SCL IO mode select). Also, as the reset values of SCL_O and SDA_O are 0 (which means "drive low level"), we need to set them to 1 (which means "high-impedance") to avoid unwanted changes on the pins. As a precaution, reset all these bits to their default values after recovery is complete. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | i2c: core: only use set_scl for bus recovery after calling prepare_recoveryJan Luebbe2015-07-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Using set_scl may be ineffective before calling the driver specific prepare_recovery callback, which might change into a test mode. So instead of setting SCL in i2c_generic_scl_recovery, move it to i2c_generic_recovery (after the optional prepare_recovery). Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Acked-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | i2c: slave eeprom: clean up sysfs bin attribute read()/write()Vladimir Zapolskiy2015-07-311-6/+0Star
|/ | | | | | | | | | | The change removes redundant sysfs binary file boundary checks, since this task is already done on caller side in fs/sysfs/file.c Note, on file size overflow read() now returns 0, and this is a correct and expected EOF notification according to POSIX. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: Mark instantiated device nodes with OF_POPULATEPantelis Antoniou2015-07-091-1/+15
| | | | | | | | | | | | Mark (and unmark) device nodes with the POPULATE flag as appropriate. This is required to avoid multi probing when using I2C and device overlays containing a mux. This patch is also more careful with the release of the adapter device which caused a deadlock with muxes, and does not break the build on !OF since the node flag accessors are not defined then. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: jz4780: Fix return value if probe failsAxel Lin2015-07-091-7/+8
| | | | | | | | | Current code returns 0 if fails to read clock-frequency DT property, fix it. Also add checking return value of clk_prepare_enable and propagate return value of devm_request_irq. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: xgene-slimpro: Fix missing mbox_free_channel call in probe error pathAxel Lin2015-07-091-0/+1
| | | | | | | Free requested mailbox channel before return error. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: I2C_MT65XX should depend on HAS_DMAGeert Uytterhoeven2015-07-091-0/+1
| | | | | | | | | | | | | If NO_DMA=y: ERROR: "dma_unmap_single" [drivers/i2c/busses/i2c-mt65xx.ko] undefined! ERROR: "dma_mapping_error" [drivers/i2c/busses/i2c-mt65xx.ko] undefined! ERROR: "dma_map_single" [drivers/i2c/busses/i2c-mt65xx.ko] undefined! Add a dependency on HAS_DMA to fix this. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* Merge tag 'char-misc-4.2-rc1' of ↵Linus Torvalds2015-06-261-5/+33
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver updates from Greg KH: "Here's the big char/misc driver pull request for 4.2-rc1. Lots of mei, extcon, coresight, uio, mic, and other driver updates in here. Full details in the shortlog. All of these have been in linux-next for some time with no reported problems" * tag 'char-misc-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (176 commits) mei: me: wait for power gating exit confirmation mei: reset flow control on the last client disconnection MAINTAINERS: mei: add mei_cl_bus.h to maintained file list misc: sram: sort and clean up included headers misc: sram: move reserved block logic out of probe function misc: sram: add private struct device and virt_base members misc: sram: report correct SRAM pool size misc: sram: bump error message level on unclean driver unbinding misc: sram: fix device node reference leak on error misc: sram: fix enabled clock leak on error path misc: mic: Fix reported static checker warning misc: mic: Fix randconfig build error by including errno.h uio: pruss: Drop depends on ARCH_DAVINCI_DA850 from config uio: pruss: Add CONFIG_HAS_IOMEM dependence uio: pruss: Include <linux/sizes.h> extcon: Redefine the unique id of supported external connectors without 'enum extcon' type char:xilinx_hwicap:buffer_icap - change 1/0 to true/false for bool type variable in function buffer_icap_set_configuration(). Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashion parport: check exclusive access before register w1: use correct lock on error in w1_seq_show() ...
| * i2c-parport: use new parport device modelSudip Mukherjee2015-06-011-5/+10
| | | | | | | | | | | | | | | | | | Modify i2c-parport driver to use the new parallel port device model. Tested-by: Jean Delvare <jdelvare@suse.de> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * i2c-parport: define ports to connectSudip Mukherjee2015-06-011-0/+23
| | | | | | | | | | | | | | | | | | | | | | As of now i2c-parport was connecting to all the available parallel ports. Lets limit that to maximum of 4 instances and at the same time define which instance connects to which parallel port. Tested-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Merge branch 'i2c/for-4.2' of ↵Linus Torvalds2015-06-2628-154/+2602
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "Highlights: - new drivers for Mediatek I2C, APM X-Gene, Broadcom Settop - major updates to at91, davinci - bugfixes to the mux infrastructure when dealing with the new quirk mechanism - more users for the bus recovery feature - further improvements to the slave framework Plus the usual bunch of smaller driver and core improvements and fixes. There is one patch removing old code from an ARM platform. This has been acked by the sh_mobile maintainer Simon Horman" * 'i2c/for-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (48 commits) i2c: busses: i2c-bcm2835: limits cdiv to allowed values i2c: sh_mobile: use proper type for timeout i2c: sh_mobile: use adapter default for timeout i2c: rcar: use proper type for timeout i2c: rcar: use adapter default for timeout i2c: designware: Make sure the device is suspended before disabling runtime PM i2c: tegra: apply size limit quirk i2c: tegra: don't advertise SMBUS_QUICK i2c: octeon: remove unused signal handling i2c: davinci: Optimize SCL generation i2c: mux: pca954x: Use __i2c_transfer because of quirks i2c: mux: Use __i2c_transfer() instead of calling parent's master_xfer() i2c: use parent adapter quirks in mux i2c: bcm2835: clear reserved bits in S-Register ARM: shmobile: r8a7740: remove I2C errata handling i2c: sh_mobile: add errata workaround i2c: at91: fix code checker warnings i2c: busses: xgene-slimpro: fix incorrect __init declation for probe i2c: davinci: Avoid sending to own address i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy() ...
| * | i2c: busses: i2c-bcm2835: limits cdiv to allowed valuesSilvan Wicki2015-06-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checks if the cdiv value is in between min (0x2) and max (0xFFFE) supported values by the bcm2835. If not, it returns -ENODEV. See page 33/34 of BCM2835-ARM-Peripherals.pdf for the DIV register. https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf Signed-off-by: Silvan Wicki <linux_wi@tinag.ch> [wsa: resolved a merge conflict] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: sh_mobile: use proper type for timeoutWolfram Sang2015-06-231-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | wait_event_timeout returns long, not int. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: sh_mobile: use adapter default for timeoutWolfram Sang2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5 seconds is a very large timeout, and it is hardcoded. Use the default timeout from 'struct adapter' which is 1 second. It can also be modified from userspace for specific workloads via i2c-dev. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>