Right amount of info in the DT

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

 



Hello everybody,

I'm a kernel newbie trying to write a GPIO driver for my platform (ARM tango),
and I'd need some advice regarding the oddity of my hardware.

I have a bunch of GPIO groups all over the place (dedicated pins, UART pins,
ethernet pins, etc.), and even though they mainly behave similarly (same way of
handling direction and value), there are some differences between them:
- IRQs, because some groups can generate interrupts and others can't;
- Alternate functions (for instance GPIO mode vs UART mode), because obviously
  dedicated pins don't have an alternate function, and for the others which have
  it, the mode-changing register is sometimes before, sometimes after the other
  regs.

My question is: where to encode this information?

I've noticed that in other device trees, there's an irq-controller property that
could probably handle the first case, but for the second, I'm not sure what I
should do. I've thought of:
1) Making up a property that would tell the driver the offset of the mode
   register in the resource, but I'm afraid this is encoding too much HW
   info in the DT.
2) Making up a property or perhaps different compatible strings that would tell
   the driver which kind of GPIO group it's dealing with, but that would maybe
   make the driver quite ad-hoc.
3) Put in another resource to deal with the mode register, but the thing is,
   this register must not be written the same way for all groups.
4) Encoding all the information (offsets, number of GPIOs, etc.) in a const
   array within the driver, but that would defeat the purpose of a DT, would
   it not?

Any help appreciated!

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



[Index of Archives]     [Linux SPI]     [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