summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
* drivers/base: fix corrupt device treeSascha Hauer2012-12-121-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_add_child is a very unsafe function. If called multiple times it allows setting the same device to different parents thus corrupting the siblings list. This happens regularly since: | commit c2e568d19c5c34a05a1002d25280bf113b72b752 | Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | Date: Sat Nov 3 16:11:05 2012 +0100 | | bus: add bus device | | automatically add it as parent of any bus device if none already specified | | we have now a nice output per bus If for example a FATfs is mounted this nice output per bus often ends with: > `---- fat0 > `---- 0 > `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL> > `---- sram00 > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > unable to handle NULL pointer dereference at address 0x0000000c > pc : [<87f08a20>] lr : [<87f08a04>] > sp : 86eff8c0 ip : 87f3fbde fp : ffffffff > r10: ffffffff r9 : 00000000 r8 : 00000003 > r7 : 86f075b8 r6 : 00000002 r5 : ffffffec r4 : 86f07544 > r3 : 00000000 r2 : 43f900b4 r1 : 00000020 r0 : 00000005 > Flags: Nzcv IRQs off FIQs off Mode SVC_32 > [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130) > > [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c) > [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14) > [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38) > [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60) This patch fixes this by adding a device to its parents children list in register_device so that dev_add_child is no longer needed. This function is removed from the tree. Now callers of register_device have to clearly set the parent *before* registering a device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Jan Lübbe <jlu@pengutronix.de>
* Cleanup Kconfig filesAlexander Shiyan2012-12-081-1/+1
| | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format, removing extraneous lines and spaces. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: Add missing DEVICE_ID_DYNAMICSascha Hauer2012-12-031-0/+1
| | | | | | Otherwise it's not possible to register multiple identical devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: add id_table supportJean-Christophe PLAGNIOL-VILLARD2012-11-151-1/+16
| | | | | | | this will be use by at24 driver Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: introduce i2c_new_dummyJean-Christophe PLAGNIOL-VILLARD2012-11-151-0/+28
| | | | | | | | | This returns an I2C client bound to the "dummy" driver, intended for use with devices that consume multiple addresses. Examples of such chips include various EEPROMS (like 24c04 and 24c08 models). Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: algo-bit add missing acknakJean-Christophe PLAGNIOL-VILLARD2012-11-151-0/+20
| | | | | | | This is need for sequential read/write. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: add versatile supportJean-Christophe PLAGNIOL-VILLARD2012-11-153-0/+121
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: add i2c-gpio supportJean-Christophe PLAGNIOL-VILLARD2012-11-153-0/+186
| | | | | | | Based on linux 3.7-rc2 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: add i2c algo bit supportJean-Christophe PLAGNIOL-VILLARD2012-11-155-1/+598
| | | | | | | | | This is needed for i2c-gpio support Based on linux 3.7-rc2 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: adapter: register it's own deviceJean-Christophe PLAGNIOL-VILLARD2012-11-153-31/+46
| | | | | | | | so we can show the this of i2c busses set the bus device as parent of all devices. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c i.MX: fixup clock support for powerpcSascha Hauer2012-10-041-14/+1
| | | | | | | This produced a warning on powerpc since the conversion to common clk support on i.MX. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx-clk'Sascha Hauer2012-10-041-2/+21
|\
| * i2c i.MX: Switch to clock supportSascha Hauer2012-10-041-2/+21
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-042-2/+2
|/ | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-032-9/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-172-9/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: register busJean-Christophe PLAGNIOL-VILLARD2012-09-231-0/+7
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | I2C: Put I2C devices on their own busSascha Hauer2012-09-141-0/+23
|/ | | | | | | | This patch adds a I2C bus on which the I2C devices and drivers register. This makes it cleaner as I2C devices won't accidently end up probed by a platform_device driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: adapt the i2c-imx driver to mpc85xx machinesRenaud Barbier2012-09-042-12/+83
| | | | | | | | | A function to calculate the frequency divider and digital filter sampling rate for the 85xx processors is added to the i2c-imx driver. Hence, this driver is usable on IMX and 85xx machines. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* IMX driver: replace imx -> fslRenaud Barbier2012-09-041-117/+118
| | | | | | | | | The IMX i2c driver is to be used by SOCs on both the ARM and PPC architetures. Use a more neutral name for the structure, function names and #define. The driver name is now "i2c-fsl". Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/randconfig'Sascha Hauer2012-08-011-1/+1
|\
| * I2C i.MX: disable driver for i.MX1Sascha Hauer2012-07-251-1/+1
| | | | | | | | | | | | | | Although the driver could work on this hardware, i.MX1 support currently lacks the necessary clocks resulting in linker errors. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: add platform_data for i2c_board_infoMarc Reilly2012-07-301-0/+1
| | | | | | | | | | | | Signed-off-by: Marc Reilly <marc@cpdesign.com.au> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: fix printf format specifierUwe Kleine-König2012-07-261-2/+2
|/ | | | | | | Use %u instead of %d for an u32 variable Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-omap: add i2c omap4 supportAlexander Aring2011-12-211-28/+103
| | | | | | | | | | | | | | Added i2c support for omap4. Tested on pcm049. Driver based on linux kernel implementation. Also added a shift to access 16-bit registers to make support for OMAP730/850 possible. If accessing a non existing slave the bus will go into arbitration mode. It's unable to recover from it. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Allow data-only i2c transfersRosen Kolev2011-10-071-24/+28
| | | | | | | | | | Modified the i2c_imx driver to support data-only transfers, without command byte. This allows to construct more complex i2c transfers and support non genuine devices like Atmel ATxx secure memory, where the master reads data after a write command. Signed-off-by: Rosen Kolev <rosen.kolev@amk-drives.bg> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-222-2/+2
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: convert to struct resourceJean-Christophe PLAGNIOL-VILLARD2011-07-232-5/+4
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* i2c i.MX: convert to struct resourceSascha Hauer2011-07-191-11/+17
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-imx: sync with kernel's driverEric Bénard2011-01-141-27/+8
| | | | | | | | | | | strange behaviour was observed with actual driver : bus lock, probe of absent adresses, wrong data read. This patch sync the driver with linux's one and after a few tests, we don't see anymore strange behaviour (tested on i.MX27). Signed-off-by: Eric Bénard <eric@eukrea.com> Acked-by: Marc Reilly <marc@cpdesign.com.au> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Move mfd drivers to drivers/mfdSascha Hauer2010-10-117-775/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-imx: wait for STOP before disabling controllerMarc Reilly2010-10-011-5/+5
| | | | | | | | | | | Makes sure that the STOP condition is transmitted before the I2C controller is disabled. This fixes a problem where writing to an external EEPROM was not working because the EEPROM waits until the STOP before initiating the write internally. Signed-off-by: Marc Reilly <marc@cpdesign.com.au> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* twl4030: Fix compiler warningsSascha Hauer2010-09-201-3/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: move busses to drivers/i2c/bussesJean-Christophe PLAGNIOL-VILLARD2010-09-206-11/+19
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* i2c rename CONFIG_DRIVER_I2C_xx to CONFIG_I2C_xxJean-Christophe PLAGNIOL-VILLARD2010-09-172-14/+14
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* i2c: fix wrong comment and symbol export for i2c_add_numbered_adapter()Wolfram Sang2010-09-161-14/+12
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add twl4030 supportSascha Hauer2010-08-063-0/+191
| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
* arm omap: Add I2C driverSascha Hauer2010-08-063-0/+808
| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
* Merge branch 'next'Sascha Hauer2010-07-033-0/+144
|\
| * i2c: add driver for the MC34704 PMICBaruch Siach2010-06-103-0/+144
| | | | | | | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: fix adapter_list manipulationBaruch Siach2010-06-171-1/+1
|/ | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: implement i2c_get_adapter()Sascha Hauer2010-05-261-1/+23
| | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-imx: change log level for No ACKEric Bénard2010-05-261-1/+1
| | | | | Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-sha-mx35-3-stack-updates' of ↵Sascha Hauer2010-01-192-39/+136
|\ | | | | | | ssh://git.pengutronix.de/git/mkl/barebox into next
| * mc13892: clean up driver interfaceMarc Kleine-Budde2010-01-181-19/+72
| | | | | | | | | | | | | | Export mc13892_reg_read, mc13892_reg_write and mc13892_set_bits function instead of exposing the i2c interface. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * mc9sdz60: clean up driver interfaceMarc Kleine-Budde2010-01-181-20/+64
| | | | | | | | | | | | | | Export mc9sdz60_reg_read, mc9sdz60_reg_write and mc9sdz60_set_bits function instead of exposing the i2c interface. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* | I2C : add NS LP3972 PMIC supportEric Benard2010-01-163-0/+114
|/ | | | | Signed-off-by: Eric Benard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Cleanup colleteral damage from renamingSascha Hauer2009-12-151-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-imx: i2c_imx_xfer return with err if sub-transfer isn't successfullMarc Kleine-Budde2009-12-091-0/+2
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>