spi & enable gpio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

In my board, I have two component that are not enabled at the boot and
need to be enabled when the spi driver start, to do that, I had to
modify the driver spi. I would like to know if it's possible to add
this possibility for the driver ?

        /* activate child device before talking to them*/
        enable_gpio = of_get_named_gpio_flags( master->dev.of_node,
"enable-gpio", 0, &flags);
        if (gpio_is_valid(enable_gpio)) {
                dev_warn(dev,"spi found reset gpio, request gpio
%d\n", enable_gpio);
               ret = gpio_request( enable_gpio, "spi-gpio-reset");
               if (ret != 0){
                        dev_warn(dev,"spi reset gpio : failed to
request gpio\n");
                        return ret;
                }
                ret = gpio_direction_output(enable_gpio, 0);
                if (ret != 0){
                        dev_warn(dev,"spi reset gpio : failed to put
direction\n");
                        return ret;
                }
                gpio_set_value(enable_gpio, 0);
                dev_warn(dev,"spi reset gpio : set gpio to 1");
                gpio_set_value(enable_gpio, 1);
        }

michael musset,
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux