All of lore.kernel.org
 help / color / mirror / Atom feed
* Right amount of info in the DT
@ 2017-04-20  9:54 Yves Lefloch
  2017-04-24  8:23 ` Linus Walleij
  0 siblings, 1 reply; 17+ messages in thread
From: Yves Lefloch @ 2017-04-20  9:54 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, gnurou, slash.tmp, Thibaud Cornic

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-06-14 13:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-20  9:54 Right amount of info in the DT Yves Lefloch
2017-04-24  8:23 ` Linus Walleij
2017-04-24 13:03   ` Yves Lefloch
2017-04-24 16:45     ` Linus Walleij
2017-04-26 15:47       ` Yves Lefloch
2017-05-07 10:26         ` Linus Walleij
2017-05-09 10:49           ` Yves Lefloch
2017-05-11 15:22             ` Linus Walleij
2017-05-12 15:31               ` Yves Lefloch
2017-05-22 15:12                 ` Linus Walleij
2017-05-24  9:41                   ` Thibaud Cornic
2017-05-29 10:02                     ` Linus Walleij
2017-05-30 13:59                       ` Yves Lefloch
2017-05-31  0:24                         ` Linus Walleij
2017-05-31 16:36                           ` Yves Lefloch
2017-06-09  8:14                             ` Linus Walleij
2017-06-14 13:51                               ` Yves Lefloch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.