Re: [RFC 2.6.27 1/1] gpiolib: add support for batch set of pins

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

 



On Sunday 28 December 2008, Jaya Kumar wrote:
> I'd like to get the start/length approach out there and in-play to
> find out if other people want to use it and how they end up using it.

As an *implementation* constraint, I might agree ... so
long as it's easily changed later.

As an *interface* constraint, I don't ... interfaces are
rarely easy to change.

However, in terms of implementation, most gpio chips have
primitives that work in terms of bitmasks rather than any
kind of start/length primitive.  Example:

 - To set bits in "u32 mask":
	iowrite32(mask, bank_base + SET_REG)
 - To clear bits in "u32 mask"
	iowrite32(mask, bank_base + CLR_REG)
 - To read bits in "u32 mask",
	return mask & ioread32(bank_base + VALUE_REG)

In short, start/length looks most like a policy, of the
"keep them out of interfaces!" flavor, than something
appropriate for an interface.  As noted above, gpio_chip
interfaces would more naturally use masks.

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

[Index of Archives]     [Gstreamer Embedded]     [Linux MMC Devel]     [U-Boot V2]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux ARM Kernel]     [Linux OMAP]     [Linux SCSI]

  Powered by Linux