summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-bcm2835.c
Commit message (Collapse)AuthorAgeFilesLines
* i2c: bcm2835: add I2C_AQ_NO_CLK_STRETCHNicola Corna2015-11-301-0/+10
| | | | | | | | | | As reported in the links given below. the BCM2835 has a hardware bug in its i2c module which prevents a correct clock stretching. This patch adds the I2C_AQ_NO_CLK_STRETCH quirk flag to i2c-bcm2835. Signed-off-by: Nicola Corna <nicola@corna.info> [wsa: put the links into the code as comments] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: busses: i2c-bcm2835: limits cdiv to allowed valuesSilvan Wicki2015-06-231-0/+8
| | | | | | | | | | | | Checks if the cdiv value is in between min (0x2) and max (0xFFFE) supported values by the bcm2835. If not, it returns -ENODEV. See page 33/34 of BCM2835-ARM-Peripherals.pdf for the DIV register. https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf Signed-off-by: Silvan Wicki <linux_wi@tinag.ch> [wsa: resolved a merge conflict] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: bcm2835: clear reserved bits in S-RegisterSilvan Wicki2015-06-171-0/+3
| | | | | | | | | | | | | | The datasheet mentions on page 31 that the bits 10-31 must be read as don't care and written as 0. https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf We cannot guarantee that we read bits 10-31 as always 0 (because the datasheet says read as don't care). We clear the bits with a bitmask to prevent writing back unknown data at the reserved bits. Signed-off-by: Silvan Wicki <linux_wi@tinag.ch> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: i2c-bcm2835: match return type of wait_for_completion_timeoutNicholas Mc Guire2015-03-151-1/+1
| | | | | | | | | | return type of wait_for_completion_timeout is unsigned long not int. as time_left is used for wait_for_completion_timeout exclusively here its type is simply changed to unsigned long. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: busses: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0Star
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. 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: remove unnecessary OOM messagesJingoo Han2014-06-021-3/+1Star
| | | | | | | | | | | | | | | 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: i2c-bcm2835: deprecate class based instantiationWolfram Sang2014-03-281-1/+1
| | | | | | | Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: bcm2835: Use devm_ioremap_resource()Jingoo Han2014-03-091-20/+4Star
| | | | | | | | | | Use devm_ioremap_resource() in order to make the code simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap_resource(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: bcm2835: Linking platform nodes to adapter nodesFlorian Meier2013-11-281-0/+1
| | | | | | | | | | In order to find I2C devices in the device tree, the platform nodes have to be known by the I2C core. This requires setting the dev.of_node parameter of the adapter. Signed-off-by: Florian Meier <florian.meier@koalo.de> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang2013-11-151-1/+1
| | | | | | | | | | | | Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* i2c: add bcm2835 driverStephen Warren2013-02-121-0/+342
This implements a very basic I2C host driver for the BCM2835 SoC. Missing features so far are: * 10-bit addressing. * DMA. Reviewed-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>