diff options
author | Christopher Bostic <cbostic@linux.vnet.ibm.com> | 2017-03-04 00:37:47 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2017-03-07 05:28:17 +0300 |
commit | 249e1ee0b0940edcb81773a69b8993c011b100c5 (patch) | |
tree | 85cbba5f869994452cd5f275d1847c9a3ed83424 | |
parent | d9dd5f45ce25cef21412fabb67d599315e3c8996 (diff) | |
download | linux-249e1ee0b0940edcb81773a69b8993c011b100c5.tar.xz |
drivers/fsi: Set I/O to standby values on unbind
On unbind send a break command to reset any connected slave
and put bus in a good state. Next set each FSI pin to standby
state, '0' except for SDA (data) which is negative active so set
it to a '1'.
Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
-rw-r--r-- | drivers/fsi/fsi-master-gpio.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c index 49f3399f4b2e..c92384648036 100644 --- a/drivers/fsi/fsi-master-gpio.c +++ b/drivers/fsi/fsi-master-gpio.c @@ -557,14 +557,24 @@ static int fsi_master_gpio_remove(struct platform_device *pdev) { struct fsi_master_gpio *master = platform_get_drvdata(pdev); + fsi_master_gpio_break(&master->master, 0); + + gpiod_set_value(master->gpio_clk, 0); devm_gpiod_put(&pdev->dev, master->gpio_clk); + gpiod_set_value(master->gpio_data, 1); devm_gpiod_put(&pdev->dev, master->gpio_data); - if (master->gpio_trans) + if (master->gpio_trans) { + gpiod_set_value(master->gpio_trans, 0); devm_gpiod_put(&pdev->dev, master->gpio_trans); - if (master->gpio_enable) + } + if (master->gpio_enable) { + gpiod_set_value(master->gpio_enable, 0); devm_gpiod_put(&pdev->dev, master->gpio_enable); - if (master->gpio_mux) + } + if (master->gpio_mux) { + gpiod_set_value(master->gpio_mux, 0); devm_gpiod_put(&pdev->dev, master->gpio_mux); + } fsi_master_unregister(&master->master); return 0; |