aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi/spi-sc18is602.c
AgeCommit message (Collapse)AuthorFilesLines
2020-04-14spi: sc18is602: Fix a typo in MODULE_DESCRIPTIONChristophe JAILLET1-1/+1
This should be 'SC18IS602', not 'SC18IC602' Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2019-10-15spi: use new `spi_transfer_delay_exec` helper where straightforwardAlexandru Ardelean1-2/+1
For many places in the spi drivers, using the new `spi_transfer_delay` helper is straightforward. It's just replacing: ``` if (t->delay_usecs) udelay(t->delay_usecs); ``` with `spi_transfer_delay(t)` which handles both `delay_usecs` and the new `delay` field. This change replaces in all places (in the spi drivers) where this change is simple. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner1-10/+1
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-22spi: sc18is602: Add OF device ID tableJavier Martinez Canillas1-1/+23
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-09-29spi: sc18is602: Change gpiod_set_value to gpiod_set_value_cansleepPhil Reid1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-09-01spi: sc18is602: Add reset control via gpio pin.Phil Reid1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-04-11Merge remote-tracking branches 'spi/topic/qup', 'spi/topic/rockchip', ↵Mark Brown1-1/+1
'spi/topic/rspi', 'spi/topic/s3c64xx' and 'spi/topic/sc18is602' into spi-next
2015-02-11spi: sc18is602: Support multiple devices on a single I2C bus if DT is configuredGuenter Roeck1-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 <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-12-22spi: Remove FSF mailing addressesJarkko Nikula1-4/+0
Signed-off-by: Jarkko Nikula <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-03-13spi: sc18is602: Convert to let spi core validate transfer speedAxel Lin1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-02-11spi: sc18is602: Move checking chip_select for SC18IS602 to sc18is602_setupAxel Lin1-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 <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-02-03spi: sc18is602: Remove sc18is602_setup() because it is done by spi coreAxel Lin1-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 <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-01-23Merge commit 'spi/topic/sc18is602' into spi-linusMark Brown1-7/+1
2014-01-17spi: sc18is602: Convert to use bits_per_word_maskAxel Lin1-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 <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-01-17spi: Remove duplicate code to set default bits_per_word settingAxel Lin1-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 <[email protected]> Acked-by: Marek Vasut <[email protected]> Acked-by: Barry Song <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-12-04spi: sc18is602: Use devm_spi_register_master()Jingoo Han1-12/+1
Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-08-23spi/sc18is602: Return -EINVAL for probe failures due to I2C function mismatchGuenter Roeck1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-08-22spi: Master driver for NXP SC18IS602/603Guenter Roeck1-0/+364
This driver adds support for NXP SC18IS602/603 I2C to SPI bus bridge. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Mark Brown <[email protected]>