summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-sc18is602.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spi: sc18is602: Change gpiod_set_value to gpiod_set_value_cansleepPhil Reid2016-09-291-1/+1
| | | | | | | | | To avoid warning when using i2c gpio expander change call to the cansleep variant. There should be no issue with sleeping in the drivers probe function. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: sc18is602: Add reset control via gpio pin.Phil Reid2016-09-011-0/+9
| | | | | | | | | This sc18is602 has a reset pin that may need to be deasserted. Add optional binding to specifiy the reset pin via a gpio and deassert during probe. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge remote-tracking branches 'spi/topic/qup', 'spi/topic/rockchip', ↵Mark Brown2015-04-121-1/+1
|\ | | | | | | 'spi/topic/rspi', 'spi/topic/s3c64xx' and 'spi/topic/sc18is602' into spi-next
| * spi: sc18is602: Support multiple devices on a single I2C bus if DT is configuredGuenter Roeck2015-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver currently only supports a single device per I2C bus since it uses the I2C bus number to set the SPI bus number. This makes it impossible to connect more than one chip to a single I2C bus. We don't want to use dynamic bus numbers unconditionally since this would result in every instantiation getting a different bus number starting with 65,535 counting down unless devicetree is configured. If devicetree is configured, however, the SPI bus number is obtained from devicetree data. So we can use dynamic SPI bus numbers in this case. Reported-and-Tested-by: Marco Menchise <marco.menchise@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> 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>
* spi: sc18is602: Convert to let spi core validate transfer speedAxel Lin2014-03-131-10/+3
| | | | | | | | | | | | Set master->max_speed_hz and master->min_speed_hz then spi core will handle checking transfer speed. So we can remove the same checking in this driver. This patch also remove testing if hz is 0 because spi->max_speed_hz will be default set to master->min_speed_hz if it was not set. So the transfer speed will never set to 0. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sc18is602: Move checking chip_select for SC18IS602 to sc18is602_setupAxel Lin2014-02-111-7/+12
| | | | | | | | | | So it will be checked when spi device is added onto the spi bus. spi_add_device() calls spi_setup() which then calls spi->master->setup(). No need to check it every time sc18is602_transfer_one() is called. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sc18is602: Remove sc18is602_setup() because it is done by spi coreAxel Lin2014-02-031-9/+0
| | | | | | | | | | | | | The checking for spi->mode is done in the implementation of spi_setup(). Calling sc18is602_check_transfer(spi, NULL, 0) is pointless because the code is equivent to checking if spi->max_speed_hz is 0. Note, sc18is602_check_transfer actually allows spi->max_speed_hz is 0 if t->speed_hz is set. So return error in sc18is602_setup() when spi->max_speed_hz is 0 does not make sense. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge commit 'spi/topic/sc18is602' into spi-linusMark Brown2014-01-231-7/+1
|\
| * spi: sc18is602: Convert to use bits_per_word_maskAxel Lin2014-01-171-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since commit 543bb25 "spi: add ability to validate xfer->bits_per_word in SPI core", the driver can set bits_per_word_mask for the master then the SPI core will reject transfers that attempt to use an unsupported bits_per_word value. So we can remove the bits_per_word checking in sc18is602_check_transfer() and let SPI core handle the checking. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* | spi: Remove duplicate code to set default bits_per_word settingAxel Lin2014-01-171-3/+0
|/ | | | | | | | | | | | The implementation in spi_setup() already set spi->bits_per_word = 8 when spi->bits_per_word is 0 before calling spi->master->setup. So we don't need to do it again in setup() callback. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Barry Song <Baohua.Song@csr.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sc18is602: Use devm_spi_register_master()Jingoo Han2013-12-041-12/+1
| | | | | | | | | Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi/sc18is602: Return -EINVAL for probe failures due to I2C function mismatchGuenter Roeck2012-08-231-1/+1
| | | | | | | | | | | | If the I2C bus master driver does not support the required functionality, the driver returns -ENODEV. This causes a silent probe failure without error message. Since the device has to be explicitly instantiated, and the user should know the correct bus, this event really reflects an error condition. Replace error return value with -EINVAL to trigger an error message showing that the probe function failed. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi: Master driver for NXP SC18IS602/603Guenter Roeck2012-08-221-0/+364
This driver adds support for NXP SC18IS602/603 I2C to SPI bus bridge. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>