- Aug 15, 2013
-
-
Jingchang Lu authored
This add struct imx_i2c_hwdata to hold more quirks data which may vary between SoCs, thus the driver can operate on more differences to support more SoCs. Signed-off-by:
Jingchang Lu <b35083@freescale.com> Reviewed-by:
Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingchang Lu authored
This add bits operation macro that differ between SoCs. Interrupt flags clear operation in I2SR differ between SoCs: write zero to clear(w0c) INT flag on i.MX, but write one to clear(w1c) INT flag on Vybrid. I2C module enable operation in I2CR also differ between SoCs: set I2CR_IEN bit enable the module on i.MX, but clear I2CR_IEN bit enable the module on Vybrid. Signed-off-by:
Jingchang Lu <b35083@freescale.com> Reviewed-by:
Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingchang Lu authored
the I2C register offset may different between SoCs, to provid support for all these chips, split the register offset into a fixed base address and a variable shift value, then the full register offset will be calculated by reg_off = ( reg_base_addr << reg_shift) Signed-off-by:
Jingchang Lu <b35083@freescale.com> Reviewed-by:
Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingchang Lu authored
wrap the readb(), writeb() into inline function calls. It would make the driver more clearer to support platform with different register offset. Signed-off-by:
Jingchang Lu <b35083@freescale.com> Reviewed-by:
Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingchang Lu authored
The id_entry field should be changed by platform driver core, driver should prevent changing it derectly. Use local variable to save and extract platform_device_id info of the dts devices instead. Signed-off-by:
Jingchang Lu <b35083@freescale.com> Reviewed-by:
Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingchang Lu authored
The module clk should be enabled before write to its register in probe(), and the clk can be disabled after. Signed-off-by:
Jingchang Lu <b35083@freescale.com> Reviewed-by:
Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingchang Lu authored
using struct representing the i2c clk{div, val} pair would make the i2c_clk_div array more clear. Signed-off-by:
Jingchang Lu <b35083@freescale.com> Reviewed-by:
Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Rudolf Marek authored
Add support for the secondary SMBus controller on the AMD SB800 and AMD FCH chipsets. Signed-off-by:
Rudolf Marek <r.marek@assembler.cz> Tested-by:
Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Andy Lutomirski authored
While writing the i2c-imc driver, I noticed that the warning message when the i2c core can't figure out how to probe is mostly useless. This trivial patch improves it. Signed-off-by:
Andy Lutomirski <luto@amacapital.net> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Santosh Shilimkar authored
Keystone SOCs uses the same I2C IP as available on DaVinci SOCs. Update the config so that ARCH_KEYSTONE can use it. Signed-off-by:
Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Santosh Shilimkar authored
This driver no longer uses definitions from mach/hardware.h. On the other hand, including this header breaks this driver on non-davinci platforms which don't have such a header. Acked-by:
Sekhar Nori <nsekhar@ti.com> Signed-off-by:
Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/i2c/busses/i2c-bfin-twi.c:585:12: warning: 'i2c_bfin_twi_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-bfin-twi.c:600:12: warning: 'i2c_bfin_twi_resume' defined but not used [-Wunused-function] Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend function to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/i2c/busses/i2c-puv3.c:249:12: warning: 'puv3_i2c_suspend' defined but not used [-Wunused-function] Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/i2c/busses/i2c-pnx.c:599:12: warning: 'i2c_pnx_controller_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-pnx.c:608:12: warning: 'i2c_pnx_controller_resume' defined but not used [-Wunused-function] Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/i2c/busses/i2c-stu300.c:945:12: warning: 'stu300_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-stu300.c:954:12: warning: 'stu300_resume' defined but not used [-Wunused-function] Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/i2c/busses/i2c-ocores.c:460:12: warning: 'ocores_i2c_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-ocores.c:471:12: warning: 'ocores_i2c_resume' defined but not used [-Wunused-function] Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/i2c/busses/i2c-designware-platdrv.c:211:12: warning: 'dw_i2c_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-designware-platdrv.c:221:12: warning: 'dw_i2c_resume' defined but not used [-Wunused-function] Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/i2c/busses/i2c-mpc.c:724:12: warning: 'mpc_i2c_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-mpc.c:734:12: warning: 'mpc_i2c_resume' defined but not used [-Wunused-function] Also, this patch makes mpc_i2c_pm_ops static, because mpc_i2c_pm_ops is not exported. Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Fabio Estevam authored
stmp_reset_block() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by:
Fabio Estevam <fabio.estevam@freescale.com> Acked-by:
Marek Vasut <marex@denx.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Aug 07, 2013
-
-
Wolfram Sang authored
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Acked-by:
Linus Walleij <linus.walleij@linaro.org>
-
Wolfram Sang authored
Since commit ab78029e (drivers/pinctrl: grab default handles from device core), we can rely on device core for setting the default pins. Compile tested only. Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Guenter Roeck authored
The I2C adapters on Freescale MPC107/824x/85xx/512x/52xx/83xx/86xx all have the same name "MPC adapter". Since I2C adapter numbers can change across reboots and even after loading/unloading an I2C bus master driver, adapter names have to be used to identify adapters and thus should be unique and well defined. Since this is not the case with this driver, it is difficult if not impossible to identify a specific adapter from user space on affected platforms. To remedy the problem, use the adapter memory address as part of the adapter name. With this patch, adapter names are: On P2020: MPC adapter at 0xfff703000 MPC adapter at 0xfff703100 On P5040: MPC adapter at 0xffe118000 MPC adapter at 0xffe118100 MPC adapter at 0xffe119000 MPC adapter at 0xffe119100 Signed-off-by:
Guenter Roeck <linux@roeck-us.net> Acked-by:
Jean Delvare <khali@linux-fr.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Sebastian Hesselbarth authored
i2c_put_adapter dereferences i2c_adapter pointer passed without check for NULL. This adds a check for non-NULL pointer to allow i2c_put_adapter called with NULL and behave the same way i2c_release_client does already. It allows to simplify drivers where you need to release the adapter during probe failures. Signed-off-by:
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Chew, Chiau Ee authored
If both IC_EMPTYFIFO_HOLD_MASTER_EN and IC_RESTART_EN are set to 1, the Designware I2C controller doesn't generate RESTART unless user specifically requests it by setting RESTART bit in IC_DATA_CMD register. Since IC_EMPTYFIFO_HOLD_MASTER_EN setting can't be detected from hardware register, we must always manually set the restart bit between messages. Signed-off-by:
Chew, Chiau Ee <chiau.ee.chew@intel.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Leilei Shang authored
To enter high speed mode, following steps should be done: 1. When running in high speed mode, i2c clock rate is different from standard mode. Clock rate must be set according to specification first. 2. When i2c controller sends a master code and wins arbitration, high speed mode is entered. If you want to enable high speed mode, the following members of platform data should be set to proper value: 1. "high_mode" should be set to "1". 2. "master_code" should be set to "8'b 0000_1xxx"(x is 0 or 1). If no master_code is set, set to default value 0xe. 3. "rate" should be set according to specification. Signed-off-by:
Leilei Shang <shangll@marvell.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Aug 05, 2013
-
-
Michael Brunner authored
Add some necessary braces that have been removed during driver cleanup. This fixes the I2C prescaler calculation. Signed-off-by:
Michael Brunner <michael.brunner@kontron.com> Tested-by:
Guenter Roeck <linux@roeck-us.net> Reviewed-by:
Guenter Roeck <linux@roeck-us.net> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Fabio Estevam authored
Recently we have been seing some reports about PIO mode not working properly. - http://www.spinics.net/lists/linux-i2c/msg11985.html - http://marc.info/?l=linux-i2c&m=137235593101385&w=2 - https://lkml.org/lkml/2013/6/24/430 Let's use DMA mode even for small transfers. Without this patch, i2c reads the incorrect sgtl5000 version on a mx28evk when touchscreen is enabled: [ 5.856270] sgtl5000 0-000a: Device with ID register 0 is not a sgtl5000 [ 9.877307] sgtl5000 0-000a: ASoC: failed to probe CODEC -19 [ 9.883528] mxs-sgtl5000 sound.12: ASoC: failed to instantiate card -19 [ 9.892955] mxs-sgtl5000 sound.12: snd_soc_register_card failed (-19) Cc: <stable@vger.kernel.org> Signed-off-by:
Fabio Estevam <fabio.estevam@freescale.com> Acked-by:
Shawn Guo <shawn.guo@linaro.org> Acked-by:
Lucas Stach <l.stach@pengutronix.de> Acked-by:
Marek Vasut <marex@denx.de> [wsa: we have a proper solution for -next, so this non intrusive solution is OK for now] Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Jul 03, 2013
-
-
Vincent Stehlé authored
This fixes the following link error: drivers/built-in.o: In function `dw_i2c_probe': of_iommu.c:(.text+0x18c8f0): undefined reference to `__aeabi_uldivmod' make: *** [vmlinux] Error 1 Signed-off-by:
Vincent Stehlé <vincent.stehle@freescale.com> Tested-by:
Kevin Hilman <khilman@linaro.org> Reviewed-by:
Christian Ruppert <christian.ruppert@abilis.com> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Jul 01, 2013
-
-
Kevin Strasser authored
Add i2c support for the on-board PLD found on some Kontron embedded modules. Originally-From: Michael Brunner <michael.brunner@kontron.com> Signed-off-by:
Kevin Strasser <kevin.strasser@linux.intel.com> Acked-by:
Guenter Roeck <linux@roeck-us.net> Acked-by:
Darren Hart <dvhart@linux.intel.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Kevin Hilman authored
There has long been a syntax problem in iop3xx_i2c_wait_event() which has been somehow hidden by the macros in <linux/wait.h>. After some recent cleanup/rework of the wait_event_* helpers, the bug has come out from hiding and now results in build failure: /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c: In function 'iop3xx_i2c_wait_event': /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:143: error: expected ')' before ';' token /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:157: error: expected ')' before ';' token /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:213: error: expected ')' before ';' token /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:291: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:551: error: expected ')' before ';' token /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:565: error: expected ')' before ';' token /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:764: error: expected ')' before ';' token /work/kernel/next/drivers/i2c/busses/i2c-iop3xx.c:176:778: error: expected ')' b Fix by removing stray ';' Signed-off-by:
Kevin Hilman <khilman@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Jun 26, 2013
-
-
Christian Ruppert authored
This patch makes the SDA hold time configurable through device tree. Signed-off-by:
Christian Ruppert <christian.ruppert@abilis.com> Signed-off-by:
Pierrick Hascoet <pierrick.hascoet@abilis.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> for arch/arc bits Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Jun 25, 2013
-
-
Sachin Surendran authored
In case of collision on i2c bus the controller which lost bus mastership stays as a slave for all subsequent transfers. This results in the i2c controller never writing to the bus for future transactions, resulting in i2c transfer timeouts. This fix checks for a collision on last I2C transaction and sets the I2COM_MASTER bit for the new transaction. Signed-off-by:
Sachin Surendran <sachin.surendran@alliedtelesis.co.nz> Signed-off-by:
Scott Wood <scottwood@freescale.com>
-
Gregory CLEMENT authored
This commit adds checking whether clock-frequency property acquisition has succeeded. If not, the frequency is set to 100kHz by default. The Device Tree binding documentation is updated accordingly. Based on the intials patches from Zbigniew Bodek Signed-off-by:
Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by:
Zbigniew Bodek <zbb@semihalf.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Arnaud Patard \(Rtp\) authored
Allow udev to autoload the module when booting with device-tree Signed-off-by:
Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Guenter Roeck authored
The driver returns -ENODEV as error code if it did not get an ACK from the device. Per Documentation/i2c/fault-codes, it should return -ENXIO. Signed-off-by:
Guenter Roeck <linux@roeck-us.net> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Jun 20, 2013
-
-
Seth Heasley authored
This patch adds the i801 SMBus Controller DeviceIDs for the Intel Coleto Creek PCH. Signed-off-by:
Seth Heasley <seth.heasley@intel.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Jun 19, 2013
-
-
Arnd Bergmann authored
I got a build error today that made me realize that it is not possible to build a kernel for a SiRF platform without enabling CONFIG_PRIMA2, since a lot of common code depends on CONFIG_PRIMA2. This fixes all occurences that appear like common SiRF code. Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Acked-by:
Wolfram Sang <wsa@the-dreams.de> Acked-by:
Mark Brown <broonie@linaro.org> Acked-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by:
Barry Song <Baohua.Song@csr.com> Acked-by:
Mike Turquette <mturquette@linaro.org>
-
Oleksandr Dmytryshyn authored
We've been lucky not to have any interrupts fire during the suspend path, otherwise we would have unpredictable behaviour in the kernel. Based on the logic of the kernel code interrupts from i2c should be prohibited during suspend. Kernel writes 0 to the I2C_IE register in the omap_i2c_runtime_suspend() function. In the other side kernel writes saved interrupt flags to the I2C_IE register in omap_i2c_runtime_resume() function. I.e. interrupts should be disabled during suspend. This works for chips with version1 registers scheme. Interrupts are disabled during suspend. For chips with version2 scheme registers writting 0 to the I2C_IE register does nothing (because now the I2C_IRQENABLE_SET register is located at this address). This register is used to enable interrupts. For disabling interrupts I2C_IRQENABLE_CLR register should be used. Because the registers I2C_IRQENABLE_SET and I2C_IE have the same addresses, the interrupt enabling procedure is unchanged. I've checked that interrupts in the i2c controller are still enabled after writting 0 to the I2C_IRQENABLE_SET register. With this patch interrupts are disabled in the omap_i2c_runtime_suspend() function. Patch is based on: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git tag: v3.10-rc2 Verified on OMAP4430. Signed-off-by:
Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Jun 18, 2013
-
-
Daniel Drake authored
On OLPC XO-1.75 (MMP2), a WARN_ON() was occurring during boot since the clock being enabled by i2c-pxa had not been prepared. Use clk_prepare_enable() to ensure that the prepare operation has taken place, and use clk_disable_unprepare() in the matching shutdown paths. Signed-off-by:
Daniel Drake <dsd@laptop.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
This reverts commit c80f5284. Regressions have been found and also run time based instantiation would fail. We need more thoughts on this. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-