Re: [PATCH 2/2] spi: img-spfi: fix spfi_setup by removing gpio_request_one

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

 



On Mon, Jul 27, 2015 at 09:34:41AM -0700, Andrew Bresticker wrote:
> 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.

Not requesting the GPIOs at all would just be a straight up bug.

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]