drivers/fsi: Set I/O to standby values on unbind
PATCH 1/1 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 <[email protected]>
--- drivers/fsi/fsi-master-gpio.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/fsi/fsi-master-gpio.c +13 -3
@@ -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 ;
Signature · 1 line
1.8.2.2
Joel Stanley
AppliedQuoted 4 lines · Christopher Bostic
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'.
I recommend you investigate fixing the device tree node so the data line is configured as active-low.
I've applied this as-is to dev-4.7.
Cheers,
Joel
Quoted 41 lines
Signed-off-by Christopher Bostic <[email protected]>--- drivers/fsi/fsi-master-gpio.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)drivers/fsi/fsi-master-gpio.c +13
-4@@ -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 ; --1.8.2.2