summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
* i2c: omap: fix fclk_rate for ti,omap4-i2cJan Weitzel2015-01-061-6/+5
| | | | | | | | The compatible "ti,omap4-i2c" don't help to get fclk_rate. So set it acording to cpu compatible: "ti,am33xx" and "ti,omap4" Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2014-11-051-1/+1
|\
| * i2c: tegra: move to fs initcallLucas Stach2014-10-081-1/+1
| | | | | | | | | | | | | | | | i2c is needed to enable voltage rails that are later needed by other drivers. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: at91: fix invalid length checkLucas Stach2014-10-211-2/+2
|/ | | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Acked-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-023-2/+8
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-163-2/+8
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/at91'Sascha Hauer2014-10-021-27/+71
|\ \
| * | I2C: at91: fix the method for interruptBo Shen2014-09-251-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | As the i2c-at91 driver won't work in the interrupt mode, so need to poll the interrupts. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | i2c: at91: add support of device treeRaphaël Poggi2014-09-251-7/+34
| | | | | | | | | | | | | | | Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | i2c: at91: add at91sam9x5 configRaphaël Poggi2014-09-251-5/+14
| | | | | | | | | | | | | | | Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | i2c: at91: fix coding style issueRaphaël Poggi2014-09-251-2/+2
| |/ | | | | | | | | Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / i2c: omap: fix dts property "clock-frequency" usageTeresa Gámez2014-10-021-10/+10
|/ | | | | | | | | Looking at the linux kernel the clock-frequency property of the device tree is used to set the bus speed and not the fclk_rate. Adapted this to be compliant with linux kernel. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-08-071-2/+2
|\ | | | | | | | | Conflicts: lib/Makefile
| * i2c: omap: fix typo in dt_idsRaphael Poggi2014-07-171-2/+2
| | | | | | | | | | | | | | Fix a typo in dt_ids name. Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: busses/Makefile: fix indentationAntony Pavlov2014-07-311-2/+2
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i2c: add Marvell 64xxx driverAntony Pavlov2014-07-313-0/+656
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver is also used for Allwinner SoCs I2C controllers. Ported from linux-3.15. The most notable barebox driver version changes: * drop platform device stuff; * drop "allwinner,sun*" stuff; * drop message offloading support; * add reg-io-width devicetree parameter to use driver with byte-oriented controller versions. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> On Armada XP: Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | 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>