summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
...
| * i2c: i2c-designware-platdrv: Drop class based scanning to improve bootup timeWolfram Sang2014-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | This driver has been flagged to drop class based instantiation. The removal improves boot-up time and is unneeded for embedded controllers. Users have been warned to switch for some time now, so we can actually do the removal. Keep the DEPRECATED flag, so the core can inform users that the behaviour finally changed now. After another transition period, this flag can go, too. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i2c-davinci: Drop class based scanning to improve bootup timeWolfram Sang2014-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | This driver has been flagged to drop class based instantiation. The removal improves boot-up time and is unneeded for embedded controllers. Users have been warned to switch for some time now, so we can actually do the removal. Keep the DEPRECATED flag, so the core can inform users that the behaviour finally changed now. After another transition period, this flag can go, too. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i2c-bfin-twi: Drop class based scanning to improve bootup timeWolfram Sang2014-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | This driver has been flagged to drop class based instantiation. The removal improves boot-up time and is unneeded for embedded controllers. Users have been warned to switch for some time now, so we can actually do the removal. Keep the DEPRECATED flag, so the core can inform users that the behaviour finally changed now. After another transition period, this flag can go, too. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i2c-bcm2835: Drop class based scanning to improve bootup timeWolfram Sang2014-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | This driver has been flagged to drop class based instantiation. The removal improves boot-up time and is unneeded for embedded controllers. Users have been warned to switch for some time now, so we can actually do the removal. Keep the DEPRECATED flag, so the core can inform users that the behaviour finally changed now. After another transition period, this flag can go, too. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i2c-at91: Drop class based scanning to improve bootup timeWolfram Sang2014-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | This driver has been flagged to drop class based instantiation. The removal improves boot-up time and is unneeded for embedded controllers. Users have been warned to switch for some time now, so we can actually do the removal. Keep the DEPRECATED flag, so the core can inform users that the behaviour finally changed now. After another transition period, this flag can go, too. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: add debug info when class instantiation was droppedWolfram Sang2014-07-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | We have a warning already when support for old-fashioned class based instantiation is about to be dropped somewhen soon from a driver. Let's have another one when it was actually dropped. This allows to remove the cruft a little earlier and still let users know what happened in the rare case they are missing devices after the change. However, there is enough interest to get rid of class based instantiation rather sooner than later because it improves boot up time. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: scx200: drop GPIO based i2c driverWolfram Sang2014-07-163-161/+0
| | | | | | | | | | | | | | | | This driver is marked as deprecated since the pre-git era. Any user left(?) should really have switched to i2c-gpio meanwhile. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Jim Cromie <jim.cromie@gmail.com>
| * i2c: s6000: remove duplicate driverWolfram Sang2014-07-164-494/+0
| | | | | | | | | | | | | | | | | | | | | | It turned out that the s6000 simply has a designware IP core and should use the designated driver for it which is way more maintained and feature complete. There are currently no users in tree, and not even a toolchain for s6000 seems to be available. So, simply remove this duplicate. If someone needs assistance in converting to the designware driver, the i2c list will be there to help. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: taos-evm: Use module_serio_driver()Christoph Jaeger2014-06-271-12/+1
| | | | | | | | | | | | | | | | Get rid of some boilerplate code by using module_serio_driver(). Signed-off-by: Christoph Jaeger <christophjaeger@linux.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI configLan Tianyu2014-06-274-97/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | Clean up ACPI related code in the i2c core and add CONFIG_I2C_ACPI to enable I2C ACPI code. Current there is a race between removing I2C ACPI operation region and ACPI AML code accessing. So make i2c core built-in if CONFIG_I2C_ACPI is set. Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * I2C/ACPI: Add i2c ACPI operation region supportLan Tianyu2014-06-273-1/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. ACPI Spec defines some access attribute to associate with i2c protocol. AttribQuick Read/Write Quick Protocol AttribSendReceive Send/Receive Byte Protocol AttribByte Read/Write Byte Protocol AttribWord Read/Write Word Protocol AttribBlock Read/Write Block Protocol AttribBytes Read/Write N-Bytes Protocol AttribProcessCall Process Call Protocol AttribBlockProcessCall Write Block-Read Block Process Call Protocol AttribRawBytes Raw Read/Write N-BytesProtocol AttribRawProcessBytes Raw Process Call Protocol On the Asus T100TA, Bios use GenericSerialBus operation region to access i2c device to get battery info. Sample code From Asus T100TA Scope (_SB.I2C1) { Name (UMPC, ResourceTemplate () { I2cSerialBus (0x0066, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2C1", 0x00, ResourceConsumer, , ) }) ... OperationRegion (DVUM, GenericSerialBus, Zero, 0x0100) Field (DVUM, BufferAcc, NoLock, Preserve) { Connection (UMPC), Offset (0x81), AccessAs (BufferAcc, AttribBytes (0x3E)), FGC0, 8 } ... } Device (BATC) { Name (_HID, EisaId ("PNP0C0A")) // _HID: Hardware ID Name (_UID, One) // _UID: Unique ID ... Method (_BST, 0, NotSerialized) // _BST: Battery Status { If (LEqual (AVBL, One)) { Store (FGC0, BFFG) If (LNotEqual (STAT, One)) { ShiftRight (CHST, 0x04, Local0) And (Local0, 0x03, Local0) If (LOr (LEqual (Local0, One), LEqual (Local0, 0x02))) { Store (0x02, Local1) } ... } The i2c operation region is defined under I2C1 scope. _BST method under battery device BATC read battery status from the field "FCG0". The request would be sent to i2c operation region handler. This patch is to add i2c ACPI operation region support. Due to there are only "Byte" and "Bytes" protocol access on the Asus T100TA, other protocols have not been tested. About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10). So far, not found such case and will add when find real case. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | Merge tag 'mfd-for-linus-3.17' of ↵Linus Torvalds2014-08-071-5/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD update from Lee Jones: "Changes to existing drivers: - checkpatch fixes throughout the subsystem - use Regmap to handle IRQs in max77686, extcon-max77693 and mc13xxx-core - use DMA in rtsx_pcr - restrict building on unsupported architectures on timberdale, cs5535 - SPI hardening in cros_ec_spi - more robust error handing in asic3, cros_ec, ab8500-debugfs, max77686 and pcf50633-core - reorder PM runtime and regulator handing during shutdown in arizona - enable wakeup in cros_ec_spi - unused variable/code clean-up in pm8921-core, cros_ec, htc-i2cpld, tps65912-spi, wm5110-tables and ab8500-debugfs - add regulator handing into suspend() in sec-core - remove pointless wrapper functions in extcon-max77693 and i2c-cros-ec-tunnel - use cross-architecture friendly data sizes in stmpe-i2c, arizona, max77686 and tps65910 - devicetree documentation updates throughout - provide power management support in max77686 - few OF clean-ups in max77686 - use manged resources in tps6105x New drivers/supported devices: - add support for s2mpu02 to sec-core - add support for Allwinner A32 to sun6i-prcm - add support for Maxim 77802 in max77686 - add support for DA9063 AD in da9063 - new driver for Intel PMICs (generic) and specifically Crystal Cove (Re-)moved drivers == - move out keyboard functionality cros_ec ==> input/keyboard/cros_ec_keyb" * tag 'mfd-for-linus-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (101 commits) MAINTAINERS: Update MFD repo location mfd: omap-usb-host: Fix improper mask use. mfd: arizona: Only free the CTRLIF_ERR IRQ if we requested it mfd: arizona: Add missing handling for ISRC3 under/overclocked mfd: wm5110: Add new interrupt register definitions mfd: arizona: Rename thermal shutdown interrupt mfd: wm5110: Add in the output done interrupts mfd: wm5110: Remove non-existant interrupts mfd: tps65912-spi: Remove unused variable mfd: htc-i2cpld: Remove unused code mfd: da9063: Add support for AD silicon variant mfd: arizona: Map MICVDD from extcon device to the Arizona core mfd: arizona: Add MICVDD to mapped regulators for wm8997 mfd: max77686: Ensure device type IDs are architecture agnostic mfd: max77686: Add Maxim 77802 PMIC support mfd: tps6105x: Use managed resources when allocating memory mfd: wm8997-tables: Suppress 'line over 80 chars' warnings mfd: kempld-core: Correct a variety of checkpatch warnings mfd: ipaq-micro: Fix coding style errors/warnings reported by checkpatch mfd: si476x-cmd: Remedy checkpatch style complains ...
| * | mfd: cros_ec: ec_dev->cmd_xfer() returns number of bytes received from ECBill Richardson2014-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When communicating with the EC, the cmd_xfer() function should return the number of bytes it received from the EC, or negative on error. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
| * | mfd: cros_ec: cleanup: Remove EC wrapper functionsBill Richardson2014-07-091-4/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the three wrapper functions that talk to the EC without passing all the desired arguments and just use the underlying communication function that passes everything in a struct intead. This is internal code refactoring only. Nothing should change. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | Merge tag 'clk-for-linus-3.17' of ↵Linus Torvalds2014-08-041-0/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.linaro.org/people/mike.turquette/linux Pull clock framework updates from Mike Turquette: "The clock framework changes for 3.17 are mostly additions of new clock drivers and fixes/enhancements to existing clock drivers. There are also some non-critical fixes and improvements to the framework core. Changes to the clock framework core include: - improvements to printks on errors - flattening the previously hierarchal structure of per-clock entries in debugfs - allow per-clock debugfs entries that are specific to a particular clock driver - configure initial clock parent and/or initial clock rate from Device Tree - several feature enhancements to the composite clock type - misc fixes New clock drivers added include: - TI Palmas PMIC - Allwinner A23 SoC - Qualcomm APQ8084 and IPQ8064 SoCs - Rockchip rk3188, rk3066 and rk3288 SoCs - STMicroelectronics STiH407 SoC - Cirrus Logic CLPS711X SoC Many fixes, feature enhancements and further clock tree support for existing clock drivers also were merged, such as Samsung's "ARMCLK down" power saving feature for their Exynos4 & Exynos5 SoCs" * tag 'clk-for-linus-3.17' of git://git.linaro.org/people/mike.turquette/linux: (86 commits) clk: Add missing of_clk_set_defaults export clk: checking wrong variable in __set_clk_parents() clk: Propagate any error return from debug_init() clk: clps711x: Add DT bindings documentation clk: Add CLPS711X clk driver clk: st: Use round to closest divider flag clk: st: Update frequency tables for fs660c32 and fs432c65 clk: st: STiH407: Support for clockgenA9 clk: st: STiH407: Support for clockgenD0/D2/D3 clk: st: STiH407: Support for clockgenC0 clk: st: Add quadfs reset handling clk: st: Add polarity bit indication clk: st: STiH407: Support for clockgenA0 clk: st: STiH407: Support for A9 MUX Clocks clk: st: STiH407: Support for Flexgen Clocks clk: st: Adds Flexgen clock binding clk: st: Remove uncessary (void *) cast clk: st: use static const for clkgen_pll_data tables clk: st: use static const for stm_fs tables clk: st: Update ST clock binding documentation ...
| * | clk: Support for clock parents and rates assigned from device treeSylwester Nawrocki2014-07-251-0/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This patch adds helper functions to configure clock parents and rates as specified through 'assigned-clock-parents', 'assigned-clock-rates' DT properties for a clock provider or clock consumer device. The helpers are now being called by the bus code for the platform, I2C and SPI busses, before the driver probing and also in the clock core after registration of a clock provider. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
* | i2c: sun6i-p2wi: Remove duplicate inclusion of module.hSachin Kamat2014-06-271-1/+0
| | | | | | | | | | | | | | | | module.h was included twice. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Acked-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | i2c: mux: pca954x: fix dependenciesLinus Walleij2014-06-271-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver causes the following randconfig build error: drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’: drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration] gpio = devm_gpiod_get(&client->dev, "reset"); ^ drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes pointer from integer without a cast [enabled by default] gpio = devm_gpiod_get(&client->dev, "reset"); ^ drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration of function ‘gpiod_direction_output’ [-Werror=implicit-function-declaration] gpiod_direction_output(gpio, 0); ^ cc1: some warnings being treated as errors make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1 This is because it is getting compiled without gpiolib, so introduce an explicit dependency. Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: sun6-p2wi: fix call to snprintfBoris BREZILLON2014-06-171-1/+1
| | | | | | | | Fixes possible issue in case pdev name contains formatting characters. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Reported-by: Kees Cook <keescook@google.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: rk3x: add NULL entry to the end of_device_id arrayDan Carpenter2014-06-121-0/+1
| | | | | | | | | | drivers/i2c/busses/i2c-rk3x.c:610:69-70: rk3x_i2c_match is not NULL terminated at line 610 Make sure of_device_id tables are NULL terminated Generated by: /kbuild/src/linux/scripts/coccinelle/misc/of_table.cocci Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: sun6i-p2wi: use proper return value in probeWolfram Sang2014-06-121-1/+1
| | | | | | | | Fixes: >> drivers/i2c/busses/i2c-sun6i-p2wi.c:243:10: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: sunxi: add P2WI (Push/Pull 2 Wire Interface) controller supportBoris BREZILLON2014-06-123-0/+359
| | | | | | | | | | | | | | | | | | | | | | | | | The P2WI controller looks like an SMBus controller which only supports byte data transfers. But, it differs from standard SMBus protocol on several aspects: - it supports only one slave device, and thus drop the address field - it adds a parity bit every 8bits of data - only one read access is required to read a byte (instead of a write followed by a read access in standard SMBus protocol) - there's no Ack bit after each byte transfer This means this bus cannot be used to interface with standard SMBus devices (the only known device to support this interface is the AXP221 PMIC). However the P2WI protocol is close enough to SMBus to be integrated in the I2C subsystem (see this thread [1] for detailed reasons that led to integrating this driver in the I2C subsystem). [1] http://www.spinics.net/lists/linux-i2c/msg15066.html Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: rk3x: add driver for Rockchip RK3xxx SoC I2C adapterMax Schwarz2014-06-123-0/+773
| | | | | | | | | | Driver for the native I2C adapter found in Rockchip RK3xxx SoCs. Configuration is only possible through devicetree. The driver is interrupt driven and supports the I2C_M_IGNORE_NAK mangling bit. Signed-off-by: Max Schwarz <max.schwarz@online.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* Merge branch 'i2c/for-next' of ↵Linus Torvalds2014-06-0632-1280/+447
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into next Pull i2c updates from Wolfram Sang: "I2C has the following updates for 3.16: - major cleanups to the rcar and sh_mobile drivers - removal of nuc900 driver which had a compile error for years - usual bunch of driver updates, bugfixes and cleanups" * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (44 commits) i2c: pca954x: Fix compilation without CONFIG_GPIOLIB i2c: mux: pca954x: Use the descriptor-based GPIO API i2c: mpc: insert DR read in i2c_fixup() i2c: bfin: turn to Resource-managed API in probe function i2c: Make of_device_id array const i2c: remove unnecessary OOM messages i2c: designware-pci: Add Haswell PCI IDs i2c: designware: Add runtime PM hooks i2c: designware: Disable device on system suspend i2c: nuc900: remove driver i2c: imx: update i2c clock divider for each transaction i2c: imx: fix the i2c bus hang issue when do repeat restart i2c: rcar: update copyright and license information i2c: rcar: janitorial cleanup after refactoring i2c: rcar: reuse status bits as enable bits i2c: rcar: remove spinlock i2c: rcar: refactor status bit handling i2c: rcar: refactor setting up msg i2c: rcar: check bus free before first message i2c: rcar: refactor irq state machine ...
| * i2c: pca954x: Fix compilation without CONFIG_GPIOLIBLaurent Pinchart2014-06-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pca954x driver recently switched to the GPIO descriptor API without including the correct <linux/gpio/consumer.h> header. This breaks compilation without CONFIG_GPIOLIB. drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’: drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration] gpio = devm_gpiod_get(&client->dev, "reset"); ^ drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes pointer from integer without a cast [enabled by default] gpio = devm_gpiod_get(&client->dev, "reset"); ^ drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration of function ‘gpiod_direction_output’ [-Werror=implicit-function-declaration] gpiod_direction_output(gpio, 0); ^ cc1: some warnings being treated as errors make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1 Fix it by including the right header. Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: mux: pca954x: Use the descriptor-based GPIO APILaurent Pinchart2014-06-031-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The ID-based GPIO API pushes handling of GPIO polarity to drivers. Simplify the driver by switching to the descriptor-based GPIO API. This also fixes a mismatch between the pca954x DT bindings that document a "reset-gpios" property and the driver that requests a "reset-gpio" property. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: mpc: insert DR read in i2c_fixup()Valentin Longchamp2014-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mpc_i2c_fixup function is called when the bus is not released by a slave. The function generates 9 pulses that should lead the slave to release the bus. The sequence that generates the pulses disables/enables the I2C module that controls the blocked bus. We have found out on the P2041 SoC that this could cause the CPU to hang (for a short delay). To avoid this, this patch introduces a read to the I2CDR register between the re-enablement of the I2C module in master mode and its returning to the slave mode instead of the delay (the final delay, between the pulses is kept), as proposed in procedure from the P2041 reference manual (16.6.2.3), and the other manuals from the mpc83xx and mpc85xx families. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: bfin: turn to Resource-managed API in probe functionSonic Zhang2014-06-031-32/+12
| | | | | | | | | | | | | | No need to free managed resources any more. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: Make of_device_id array constJingoo Han2014-06-025-5/+5
| | | | | | | | | | | | | | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Peter Korsgaard <peter@korsgaard.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: remove unnecessary OOM messagesJingoo Han2014-06-0215-44/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. For example, k.alloc and v.alloc failures use dump_stack(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Felipe Balbi <balbi@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware-pci: Add Haswell PCI IDsMika Westerberg2014-06-021-0/+22
| | | | | | | | | | | | | | | | Intel Haswell has the same I2C host controller than Baytrail and it can also be enumerated as a PCI device. Add the PCI IDs to the driver list. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Add runtime PM hooksMika Westerberg2014-06-021-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible that after entering runtime PM suspend the controller context is lost due the fact that its power is removed. This happens for example on Asus T100, an Intel Baytrail based tablet/laptop. In order to get the controller back to functional state, we need to implement runtime PM hooks which will re-initialize the hardware during runtime PM resume. We can re-use the existing system suspend hooks as the steps to resume/suspend the controller are the same. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Disable device on system suspendMika Westerberg2014-06-021-0/+1
| | | | | | | | | | | | | | | | | | | | Userspace can initiate system suspend on arbitrary times which means that device drivers must make sure that their device gets quiesced before system suspend is entered. Therefore disable the I2C host controller in the driver system suspend hook. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: nuc900: remove driverWolfram Sang2014-06-023-717/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Arnd said in another patch: "As far as I can tell, this driver must have produced this error for as long as it has been merged into the mainline kernel, but it was never part of the normal build tests: drivers/i2c/busses/i2c-nuc900.c: In function 'nuc900_i2c_probe': drivers/i2c/busses/i2c-nuc900.c:601:17: error: request for member 'apbfreq' in something not a structure or union ret = (i2c->clk.apbfreq)/(pdata->bus_freq * 5) - 1; ^ This is an attempt to get the driver to build and possibly work correctly, although I do wonder whether we should just remove it, as it has clearly never worked." I agree with removing it since nobody showed interest in Arnd's fixup patch. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: Wan ZongShun <mcuos.com@gmail.org> Acked-by: Arnd Bergmann <arnd@arndb.de>
| * i2c: imx: update i2c clock divider for each transactionFugang Duan2014-06-021-44/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since IMX serial SOCs support low bus freq mode, some clocks freq may change to save power. I2C needs to check the clock source and update the divider. For example: i.MX6SL I2C clk is from IPG_PERCLK which is sourced from IPG_CLK. Under normal operation, IPG_CLK is 66MHz, ipg_perclk is at 22MHz. In low bus freq mode, IPG_CLK is at 12MHz and IPG_PERCLK is down to 4MHz. So the I2C driver must update the divider register for each transaction when the current IPG_PERCLK is not equal to the clock of previous transaction. Signed-off-by: Fugang Duan <B38611@freescale.com> [wsa: removed an outdated comment and simplified debug output] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: imx: fix the i2c bus hang issue when do repeat restartFugang Duan2014-06-021-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test i2c device Maxim max44009, datasheet is located at: http://www.maximintegrated.com/datasheet/index.mvp/id/7175 The max44009 support repeat operation like: read -> repeat restart -> read/write The current i2c imx host controller driver don't support this operation that causes i2c bus hang due to "MTX" is cleared in .i2c_imx_read(). If "read" is the last message there have no problem, so the current driver supports all SMbus operation like: write -> repeat restart -> read/write IMX i2c controller for master receiver has some limitation: - If it is the last byte for one operation, it must generate STOP signal before read I2DR to prevent controller from generating another clock cycle. - If it is the last byte in the read, and then do repeat restart, it must set "MTX" before read I2DR to prevent controller from generating another extra clock cycle. The patch is to fix the issue. Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: update copyright and license informationWolfram Sang2014-06-011-8/+6
| | | | | | | | | | | | | | | | | | | | Make clear that the driver is GPL v2 only. Remove FSF address. Remove filename in comment. Update copyright information. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: janitorial cleanup after refactoringWolfram Sang2014-06-011-45/+5
| | | | | | | | | | | | | | | | | | | | Remove some obvious comments, remove some superfluous debug output (the error code carries the same information), some white space fixing... Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: reuse status bits as enable bitsWolfram Sang2014-06-011-13/+4
| | | | | | | | | | | | | | | | | | | | Status register and enable register are identical regarding their layout. Use the bit definitions for both. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: remove spinlockWolfram Sang2014-06-011-22/+0
| | | | | | | | | | | | | | | | | | The i2c core has per-adapter locks, so no need to protect again. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: refactor status bit handlingWolfram Sang2014-06-011-13/+7
| | | | | | | | | | | | | | | | | | | | The old macros made it harder to see what was actually happening. Replace them with something more readable. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: refactor setting up msgWolfram Sang2014-06-011-25/+5
| | | | | | | | | | | | | | | | | | | | | | Setting up a read or write message is similar enough to be done in one function. Also, move a helper function into the new function since it is only used here. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: check bus free before first messageWolfram Sang2014-06-011-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | We should always check if the bus is free, independently if it is a read or write. It should be done before the first message, though. After that, we ourselves keep the bus busy. Remove a 'ret' assignment which only silenced a build warning. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: refactor irq state machineWolfram Sang2014-06-011-32/+7
| | | | | | | | | | | | | | | | | | | | | | Remove the seperate functions and use designated constants. As readable but less overhead. Actually, this is even more readable since the old function used a mix of "=" and "|=". Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: refactor bus state machineWolfram Sang2014-06-011-27/+10
| | | | | | | | | | | | | | | | | | | | Remove the seperate functions and use designated constants. As readable but less overhead. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: no need to store irq numberWolfram Sang2014-06-011-5/+4
| | | | | | | | | | | | | | | | | | We use devm, so irq number is only needed during probe. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: not everything needs to be a functionWolfram Sang2014-06-011-11/+3
| | | | | | | | | | | | | | | | | | Very basic operations, just called once, can also go to the caller. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: sh_mobile: add compatibles for additional SoCWolfram Sang2014-06-011-0/+3
| | | | | | | | | | Signed-off-by: Wolfram Sang <wsa@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: add compatibles for additional SoCWolfram Sang2014-06-011-0/+3
| | | | | | | | | | Signed-off-by: Wolfram Sang <wsa@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: gpio: Use devm_gpio_request()Jingoo Han2014-05-221-18/+7
| | | | | | | | | | | | | | | | | | | | Use devm_gpio_request() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Violeta Menendez <violeta.menendez@codethink.co.uk> Reviewed-by: Ian Molton <ian.molton@codethink.co.uk> Tested-by: Violeta Menendez <violeta.menendez@codethink.co.uk> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
OpenPOWER on IntegriCloud