* [PATCH 0/1] spi: sc18is602: Add reset control via gpio pin. @ 2016-08-31 7:31 Phil Reid [not found] ` <1472628698-10599-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Phil Reid @ 2016-08-31 7:31 UTC (permalink / raw) To: broonie-DgEjT+Ai2ygdnm+yROfE0A, linux-spi-u79uwXL29TY76Z2rM5mHXA Cc: Phil Reid I didn't not check for null on devm_gpiod_get_optional as gpiod_set_value does this on entry. Frequency of this seemed low enough that the function call doesn't add any significant overhead. I can add a check if required. Phil Reid (1): spi: sc18is602: Add reset control via gpio pin. drivers/spi/spi-sc18is602.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <1472628698-10599-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>]
* [PATCH 1/1] spi: sc18is602: Add reset control via gpio pin. [not found] ` <1472628698-10599-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> @ 2016-08-31 7:31 ` Phil Reid [not found] ` <1472628698-10599-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 2016-08-31 14:49 ` [PATCH 0/1] spi: sc18is602: Add reset control via gpio pin Mark Brown 1 sibling, 1 reply; 6+ messages in thread From: Phil Reid @ 2016-08-31 7:31 UTC (permalink / raw) To: broonie-DgEjT+Ai2ygdnm+yROfE0A, linux-spi-u79uwXL29TY76Z2rM5mHXA Cc: Phil Reid 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-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> --- drivers/spi/spi-sc18is602.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-sc18is602.c b/drivers/spi/spi-sc18is602.c index 36af4d4..5666b5d 100644 --- a/drivers/spi/spi-sc18is602.c +++ b/drivers/spi/spi-sc18is602.c @@ -23,6 +23,7 @@ #include <linux/pm_runtime.h> #include <linux/of.h> #include <linux/platform_data/sc18is602.h> +#include <linux/gpio/consumer.h> enum chips { sc18is602, sc18is602b, sc18is603 }; @@ -50,6 +51,8 @@ struct sc18is602 { u8 buffer[SC18IS602_BUFSIZ + 1]; int tlen; /* Data queued for tx in buffer */ int rindex; /* Receive data index in buffer */ + + struct gpio_desc *reset; }; static int sc18is602_wait_ready(struct sc18is602 *hw, int len) @@ -257,6 +260,12 @@ static int sc18is602_probe(struct i2c_client *client, hw = spi_master_get_devdata(master); i2c_set_clientdata(client, hw); + /* assert reset and then release */ + hw->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(hw->reset)) + return PTR_ERR(hw->reset); + gpiod_set_value(hw->reset, 0); + hw->master = master; hw->client = client; hw->dev = dev; -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1472628698-10599-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>]
* Applied "spi: sc18is602: Add reset control via gpio pin." to the spi tree [not found] ` <1472628698-10599-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> @ 2016-09-01 20:35 ` Mark Brown 0 siblings, 0 replies; 6+ messages in thread From: Mark Brown @ 2016-09-01 20:35 UTC (permalink / raw) To: Phil Reid Cc: Mark Brown, broonie-DgEjT+Ai2ygdnm+yROfE0A, linux-spi-u79uwXL29TY76Z2rM5mHXA The patch spi: sc18is602: Add reset control via gpio pin. has been applied to the spi tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From f99008013e199e6b88ef26c98ecb042c94c7450c Mon Sep 17 00:00:00 2001 From: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> Date: Wed, 31 Aug 2016 15:31:38 +0800 Subject: [PATCH] spi: sc18is602: Add reset control via gpio pin. 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-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> --- drivers/spi/spi-sc18is602.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-sc18is602.c b/drivers/spi/spi-sc18is602.c index 36af4d48a700..5666b5d20b87 100644 --- a/drivers/spi/spi-sc18is602.c +++ b/drivers/spi/spi-sc18is602.c @@ -23,6 +23,7 @@ #include <linux/pm_runtime.h> #include <linux/of.h> #include <linux/platform_data/sc18is602.h> +#include <linux/gpio/consumer.h> enum chips { sc18is602, sc18is602b, sc18is603 }; @@ -50,6 +51,8 @@ struct sc18is602 { u8 buffer[SC18IS602_BUFSIZ + 1]; int tlen; /* Data queued for tx in buffer */ int rindex; /* Receive data index in buffer */ + + struct gpio_desc *reset; }; static int sc18is602_wait_ready(struct sc18is602 *hw, int len) @@ -257,6 +260,12 @@ static int sc18is602_probe(struct i2c_client *client, hw = spi_master_get_devdata(master); i2c_set_clientdata(client, hw); + /* assert reset and then release */ + hw->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(hw->reset)) + return PTR_ERR(hw->reset); + gpiod_set_value(hw->reset, 0); + hw->master = master; hw->client = client; hw->dev = dev; -- 2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/1] spi: sc18is602: Add reset control via gpio pin. [not found] ` <1472628698-10599-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 2016-08-31 7:31 ` [PATCH 1/1] " Phil Reid @ 2016-08-31 14:49 ` Mark Brown [not found] ` <20160831144934.GA5967-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 1 sibling, 1 reply; 6+ messages in thread From: Mark Brown @ 2016-08-31 14:49 UTC (permalink / raw) To: Phil Reid; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 597 bytes --] On Wed, Aug 31, 2016 at 03:31:37PM +0800, Phil Reid wrote: > I didn't not check for null on devm_gpiod_get_optional as gpiod_set_value > does this on entry. Frequency of this seemed low enough that the function > call doesn't add any significant overhead. I can add a check if required. Please don't send cover letters for single patches, if there is anything that needs saying put it in the changelog of the patch or after the --- if it's administrative stuff. This reduces mail volume and ensures that any important information is recorded in the changelog rather than being lost. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20160831144934.GA5967-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>]
* Re: [PATCH 0/1] spi: sc18is602: Add reset control via gpio pin. [not found] ` <20160831144934.GA5967-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> @ 2016-09-01 1:47 ` Phil Reid [not found] ` <fecfdf07-a3e6-c84d-31dc-b1e2b7486868-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Phil Reid @ 2016-09-01 1:47 UTC (permalink / raw) To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA On 31/08/2016 22:49, Mark Brown wrote: > On Wed, Aug 31, 2016 at 03:31:37PM +0800, Phil Reid wrote: >> I didn't not check for null on devm_gpiod_get_optional as gpiod_set_value >> does this on entry. Frequency of this seemed low enough that the function >> call doesn't add any significant overhead. I can add a check if required. > > Please don't send cover letters for single patches, if there is anything > that needs saying put it in the changelog of the patch or after the --- > if it's administrative stuff. This reduces mail volume and ensures that > any important information is recorded in the changelog rather than being > lost. > Ok. Would you like me to resubmit the patch? -- Regards Phil Reid -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <fecfdf07-a3e6-c84d-31dc-b1e2b7486868-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>]
* Re: [PATCH 0/1] spi: sc18is602: Add reset control via gpio pin. [not found] ` <fecfdf07-a3e6-c84d-31dc-b1e2b7486868-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> @ 2016-09-01 10:04 ` Mark Brown 0 siblings, 0 replies; 6+ messages in thread From: Mark Brown @ 2016-09-01 10:04 UTC (permalink / raw) To: Phil Reid; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 551 bytes --] On Thu, Sep 01, 2016 at 09:47:23AM +0800, Phil Reid wrote: > On 31/08/2016 22:49, Mark Brown wrote: > > Please don't send cover letters for single patches, if there is anything > > that needs saying put it in the changelog of the patch or after the --- > > if it's administrative stuff. This reduces mail volume and ensures that > > any important information is recorded in the changelog rather than being > > lost. > Ok. > Would you like me to resubmit the patch? It should be fine, I've still not looked at it yet (this was triage on my inbox). [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-09-01 20:35 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-08-31 7:31 [PATCH 0/1] spi: sc18is602: Add reset control via gpio pin Phil Reid [not found] ` <1472628698-10599-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 2016-08-31 7:31 ` [PATCH 1/1] " Phil Reid [not found] ` <1472628698-10599-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 2016-09-01 20:35 ` Applied "spi: sc18is602: Add reset control via gpio pin." to the spi tree Mark Brown 2016-08-31 14:49 ` [PATCH 0/1] spi: sc18is602: Add reset control via gpio pin Mark Brown [not found] ` <20160831144934.GA5967-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 2016-09-01 1:47 ` Phil Reid [not found] ` <fecfdf07-a3e6-c84d-31dc-b1e2b7486868-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 2016-09-01 10:04 ` Mark Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).