summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-gpio.c
Commit message (Collapse)AuthorAgeFilesLines
*---. Merge remote-tracking branches 'spi/topic/falcon', 'spi/topic/fsf', ↵Mark Brown2015-02-081-6/+2
|\ \ \ | | | | | | | | | | | | 'spi/topic/fsl', 'spi/topic/fsl-dspi' and 'spi/topic/gpio' into spi-next
| | | * spi/gpio: fixed space coding style issueNizam Haider2015-01-051-2/+2
| |_|/ |/| | | | | | | | | | | | | | | | | fixed a coding style issue Signed-off-by: Nizam Haider <nizamhaider786@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * spi: Remove FSF mailing addressesJarkko Nikula2014-12-221-4/+0
| |/ |/| | | | | | | Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds2014-12-141-1/+0
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
| * spi: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | | | | | | | | 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>
* | spi: spi-gpio: Fix compiler warning when building for 64 bit systemsTorsten Fleischer2014-11-081-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assignment of SPI_GPIO_NO_CHIPSELECT to cs_gpios[0] causes the following compiler warning, when building for 64 bit systems: "warning: overflow in implicit constant conversion [-Woverflow]". This is because the SPI_GPIO_NO_CHIPSELECT flag is a '-1' type casted to unsigned long and cs_gpios is of the type int. Furthermore the chip select's GPIO number is locally stored as unsigned int and compared with SPI_GPIO_NO_CHIPSELECT. Thus the result of the comparison is always false, if unsigned long and unsigned int have a different size. As part of the fix this patch adds a check for the device tree's cs-gpios property. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Torsten Fleischer <torfl6749@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | spi: spi-gpio: Add dt support for a single device with no chip selectTorsten Fleischer2014-11-041-6/+15
|/ | | | | | | | | In order to describe a single slave device that has no chip select line the 'num-chipselects' property has to be <0> and the 'cs-gpios' property doesn't need to be set. Signed-off-by: Torsten Fleischer <torfl6749@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: spi-gpio: Make of_device_id array constJingoo Han2014-05-071-1/+1
| | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/init', ↵Mark Brown2014-03-301-1/+0
|\ \ | | | | | | | | | 'spi/topic/mpc512x-psc', 'spi/topic/mpc52xx', 'spi/topic/mxs', 'spi/topic/nuc900', 'spi/topic/oc-tiny' and 'spi/topic/octeon' into spi-next
| | * spi: delete non-required instances of include <linux/init.h>Paul Gortmaker2014-02-031-1/+0
| |/ | | | | | | | | | | | | | | | | | | None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| |
| \
*-. \ Merge remote-tracking branches 'spi/topic/drivers', 'spi/topic/dw', ↵Mark Brown2014-03-301-1/+1
|\ \ \ | | |/ | |/| | | | 'spi/topic/efm32', 'spi/topic/ep93xx', 'spi/topic/fsl', 'spi/topic/fsl-dspi', 'spi/topic/fsl-espi' and 'spi/topic/gpio' into spi-next
| | * spi: fix pointer-integer size mismatch warningSeongJae Park2014-02-041-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | Fix the pointer-integer size mismatch warning below: drivers/spi/spi-gpio.c: In function ‘spi_gpio_setup’: drivers/spi/spi-gpio.c:252:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] cs = (unsigned int) spi->controller_data; ^ Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | spi: bitbang: Make spi_bitbang_stop() return voidAxel Lin2014-03-291-3/+2
|/ | | | | | | spi_bitbang_stop() never fails, so make it return void. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: spi-gpio: Use 'cansleep' variants to access GPIOEzequiel Garcia2013-11-241-4/+4
| | | | | | | | | The GPIO chip in use could be of any kind, and therefore might sleep when accesing the GPIO lines. Take account of this by using cansleep instead, which is the most generic case. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'spi/topic/gpio' into spi-nextMark Brown2013-10-251-0/+1
|\
| * spi: gpio: Include linux/of.h headerSachin Kamat2013-10-161-0/+1
| | | | | | | | | | | | | | 'of_match_ptr' is defined in linux/of.h. Include it explicitly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* | spi: bitbang: Let spi_bitbang_start() take a reference to masterAxel Lin2013-09-171-3/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Many drivers that use bitbang library have a leak on probe error paths. This is because once a spi_master_get() call succeeds, we need an additional spi_master_put() call to free the memory. Fix this issue by moving the code taking a reference to master to spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on success. With this change, the caller is responsible for calling spi_bitbang_stop() to decrement the reference and spi_master_put() as counterpart of spi_alloc_master() to prevent a memory leak. So now we have below patten for drivers using bitbang library: probe: spi_alloc_master -> Init reference count to 1 spi_bitbang_start -> Increment reference count remove: spi_bitbang_stop -> Decrement reference count spi_master_put -> Decrement reference count (reference count reaches 0) Fixup all users accordingly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Suggested-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Acked-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: use dev_get_platdata()Jingoo Han2013-08-291-2/+2
| | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'spi/topic/core' into spi-nextMark Brown2013-06-261-2/+0
|\
| * spi: remove unnecessary platform_set_drvdata()Jingoo Han2013-05-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi: convert drivers to use bits_per_word_maskStephen Warren2013-05-291-3/+1
|/ | | | | | | | | | Fill in the recently added spi_master.bits_per_word_mask field in as many drivers as possible. Make related cleanups, such as removing any redundant error-checking, or empty setup callbacks. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi-gpio: init CS before spi_bitbang_setup()Josef Ahmad2013-04-101-1/+1
| | | | | | | | | | | | | | | | spi_bitbang_setup() deasserts the chip select line to initialise the device. The chip select GPIO line is obtained from spi_gpio->cs_gpios[] private data. Currently, devices that are not registered under devicetree environment will call into spi_bitbang_setup() with stale cs_gpios[]. This patch ensures spi_gpio->cs_gpios[] is always initialised prior to calling spi_bitbang_setup(). Reviewed-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Josef Ahmad <josef.ahmad@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi: spi-gpio: Add checks for the dt propertiesMaxime Ripard2013-01-261-3/+20
| | | | | | | | | | | The bindings assumed that the gpios properties were always there, which made the NO_TX and NO_RX mode not usable from device tree. Add extra checks to make sure that the driver can work if either MOSI or MISO is not used. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi: Remove HOTPLUG section attributesGrant Likely2012-12-071-7/+6
| | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Bill Pemberton has done most of the legwork on this series. I've used his script to purge the attributes from the drivers/gpio tree. Reported-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* spi/gpio: Fix stub for spi_gpio_probe_dt()Mark Brown2012-09-071-1/+1
| | | | | | | | The gpio_ was missing from the name. Add a name for the parameter while we're at it since GCC warns. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi: spi-gpio: Add DT bindingsDaniel Mack2012-09-061-3/+96
| | | | | | | | This patch adds DT bindings to the spi-gpio driver and some documentation about how to use it. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi: spi-gpio: store chipselect information in private structureDaniel Mack2012-09-061-10/+24
| | | | | | | | | | | | | | The spi-gpio driver currently assumes the chipselect gpio number is stored in ->controller_data of the device's static board information. In devicetree environments, this information is unavailable and has to be derived from the DT node. This patch moves the gpio storage to the controller's private data so the DT bindings can easily build upon the driver. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi/gpio: start with CS non-activeUwe Kleine-König2012-07-101-1/+2
| | | | | | | | | | | | The chip select line was configured as output with the initial value being active explicitly. It was later deasserted during spi_bitbang_setup() without any clock activity in between. So it makes no sense to activate the device at all and the chip select line can better start non-active. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi/gpio: fix section mismatch warningManuel Lauss2011-12-071-2/+2
| | | | | | | | | | | | | Fixes: The function __devinit spi_gpio_probe() references a function __init spi_gpio_alloc.isra.4(). If spi_gpio_alloc.isra.4 is only used by spi_gpio_probe then annotate spi_gpio_alloc.isra.4 with a matching annotation. [wsa: fix spi_gpio_request(), too] Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
* spi: Add module.h to implicit users in drivers/spiPaul Gortmaker2011-10-311-0/+1
| | | | | | | | We are clipping down the presence of module.h, since it was everywhere. If you really need it, you better call it out, as per this changeset. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* drivercore: Add helper macro for platform_driver boilerplateGrant Likely2011-10-251-16/+5
| | | | | | | | | | | | | | For simple modules that contain a single platform_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_platform_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Reviewed-by: Magnus Damm <magnus.damm@gmail.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
* spi: reorganize driversGrant Likely2011-06-061-0/+429
Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers. This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file. v2: - Use 'spi-' prefix instead of 'spi_' to match what seems to be be the predominant pattern for subsystem prefixes. - Clean up filenames in Kconfig and header comment blocks Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@linaro.org>
OpenPOWER on IntegriCloud