[PATCH linux dev-4.7] drivers/fsi: Set I/O to standby values on unbind

Joel Stanley joel at jms.id.au
Tue Mar 7 13:26:54 AEDT 2017


On Sat, Mar 4, 2017 at 8:07 AM, Christopher Bostic
<cbostic at linux.vnet.ibm.com> wrote:
> 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

>
> Signed-off-by: Christopher Bostic <cbostic at linux.vnet.ibm.com>
> ---
>  drivers/fsi/fsi-master-gpio.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
> index 49f3399..c923846 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;
> --
> 1.8.2.2
>


More information about the openbmc mailing list