summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
...
* | i2c: add Atmel AT91 driverRaphaël Poggi2014-07-253-0/+442
| | | | | | | | | | Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: import SMBus stuff from linuxAntony Pavlov2014-07-142-1/+372
|/ | | | | | | | | | | | | | | | | | | | This patch imports i2c_smbus_{read,write}* functions from linux-3.15. Here is a quote from linux.git/Documentation/i2c/smbus-protocol: If you write a driver for some I2C device, please try to use the SMBus commands if at all possible (if the device uses only that subset of the I2C protocol). This makes it possible to use the device driver on both SMBus adapters and I2C adapters (the SMBus command set is automatically translated to I2C on I2C adapters, but plain I2C commands can not be handled at all on most pure SMBus adapters). So having i2c_smbus_{read,write}* functions in barebox makes porting of linux i2c client drivers much easier as many drivers rely on these smbus functions. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mips'Sascha Hauer2014-07-041-3/+52
|\
| * i2c: i2c_gpio: add devicetree supportAntony Pavlov2014-06-251-3/+52
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: versatile: add devicetree supportAntony Pavlov2014-06-231-0/+7
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: add Tegra driverLucas Stach2014-05-153-0/+704
| | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: implement of_find_i2c_adapter_by_nodeSascha Hauer2014-03-281-0/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: i.MX: move to earlier initcallSascha Hauer2014-03-281-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/modalias'Sascha Hauer2014-03-071-1/+1
|\
| * i2c/spi: match of_modaliasesSascha Hauer2014-02-071-1/+1
| | | | | | | | | | | | | | | | i2c/spi devices in the devicetree often come with a "vendor,device" comaptible string. These do not match in barebox, so add a device_match_of_modalias function which does exactly that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | drivers/i2c/i2c.c: Fix sparse warningsAlexander Shiyan2014-02-171-4/+3
|/ | | | | | | | drivers/i2c/i2c.c:246:19: warning: symbol 'i2c_new_device' was not declared. Should it be static? drivers/i2c/i2c.c:274:6: warning: symbol 'of_i2c_register_devices' was not declared. Should it be static? Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/omap-drivers'Sascha Hauer2013-12-061-1/+27
|\
| * i2c: omap: Add devicetree supportSascha Hauer2013-11-221-1/+27
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: Add missing includesSascha Hauer2013-11-082-0/+2
|/ | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-omap: fix reported revisonJan Weitzel2013-10-141-1/+1
| | | | | | Report correct major and minor revision Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: omap: remove unncessary printfSascha Hauer2013-09-271-1/+0
| | | | | | | A printf in the driver should be dev_* and contain useful information. Both is not the case, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-omap: Update driverJan Weitzel2013-09-271-187/+448
| | | | | | | | | | | | | The driver didn't work well with at24 driver. NACKS are lost. Errors are lost in isr due to the local variable err. Also we didn't wait for bus free in omap_i2c_xfer_msg. Fix issues and get other improvements from linux kernel Tested on OMAP4 and AM335x Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-omap: fix am33xx and omap3 fclk_rateJan Weitzel2013-08-311-2/+2
| | | | | | | | commit f64ed12b accidentally swap fclk_rate from am33xx and omap3. Revert this change. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: Reuse "driver_match" for I2C busAlexander Shiyan2013-07-151-21/+1
| | | | | | | This will allow to use device_ids and make code a bit smaller. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next-manual/oftree-linux-sync'Sascha Hauer2013-07-021-1/+1
|\
| * OF: base: convert and remove device_node_for_nach_childSebastian Hesselbarth2013-06-201-1/+1
| | | | | | | | | | | | | | | | Remove device_node_for_nach_child and convert users to corresponding imported OF API functions. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c-omap: Remove cpu_is functions completelyTeresa Gámez2013-06-231-22/+67
| | | | | | | | | | | | | | | | This patch removes the call of the cpu_is_* functions completely and uses id_tables instead. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: AM33xx: Add i2c support for AM33xxTeresa Gámez2013-06-211-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Added device register functions and cpu_is_am33xx() function. Adapted the i2c-omap driver. AM335x has a lower clock rate and the timeout of polling the isr function had to be increased. Based on a patch from Shravan Kumar <shravan.k@phytec.in>. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c-omap: cleanup cpu_is functionsTeresa Gámez2013-06-211-102/+57
|/ | | | | | | | | | cpu_is_omap2430() is set when CONFIG_ARCH_OMAP is enabled. This fits for all OMAP/AM33xx boards supported in barebox. Cleaned up all conditions that use the cpu_is_omap2430(). Also removed some unused defines. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: fsl: Add devicetree probe supportSascha Hauer2013-05-311-0/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: Add devicetree supportSascha Hauer2013-05-311-0/+42
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: Add support for dynamic i2c bus numbersSascha Hauer2013-05-201-2/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: remove dead codeSascha Hauer2013-05-201-16/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: Add missing result checkSascha Hauer2013-05-201-0/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-134-26/+4
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>