Hi Sifan, On Mon, Jul 27, 2015 at 5:11 AM, Sifan Naeem <sifan.naeem@xxxxxxxxxx> wrote: > spfi_setup may be called many times bye the spi framework, but > gpio_request_one can only be called once without freeing, repeatedly > calling gpio_request_one will cause an error to be thrown, which causes > the request to spi_setup to be marked as failed. > > We can simply use gpio_direction_output to set the direction of the > gpio instead of gpio_request_one to put the gpio in to initial state, > after which the spi framework can control the chipselect line via gpio > using gpio_set_value. I don't think we want to leave the CS GPIOs un-requested. Instead, we could either request them all at probe() time (and then set direction in setup()) or have a per-spi_device flag that indicates whether or not the GPIO has been requested. -Andrew -- 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