On Wed, Oct 19, 2016 at 2:55 PM, Maxime Ripard <
maxime.rip...@free-electrons.com> wrote:

> On Wed, Oct 19, 2016 at 11:53:10AM +0200, Hans de Goede wrote:
> > > > If all the hardware allows you to-do is set / read the pin, you
> > > > could write a gpio-chip driver for it, and then attach a generic
> > > > cec-over-gpio driver to that, that seems like a better idea then
> > > > an Allwinner specific bit-bang driver.
> > >
> > > That might not be easy to do. The CEC line is a dedicated pin on the
> SoC,
> > > leading to the HDMI controller, much like the HDMI DDC lines. And the
> control
> > > bits are in the middle of the HDMI register space.
> > >
> > > Doing a one-line GPIO controller for that pin should work, though it's
> a
> > > really convoluted approach.
>
> +1
>
> > If we're going to spend time writing a bit-bang cec driver using
> > timers we should IMHO really do this through a gpio indirection so
> > that the entire bit-bang code can be shared.
>
> Well, it might not be even shared. Someone hooking it on a GPIO will
> have an interrupt on that GPIO, and that will change the polling logic
> significantly.
>
> > As for this being convoluted, it does not need to be that bad. I
> > think you're thinking too much along the lines of doing a
> > stand-alone gpio driver + regmap or some such to access the
> > register. But we can just have the hdmi encoder driver register a
> > gpio_chip, without doing 2 separate drivers, and then the code
> > should be pretty clean.
>
> You'd still have to tie it to the CEC stuff. And really, it's not a
> GPIO, but more just an O and an I ;)
>
>
I think I'm little confused about all of this gpio-chip driver and probably
I don't understanding it correctly :)
Do you want to create gpio-driver that "fake" gpio hardware and is
using this HDMI CEC register to read/write CEC line?
How in that case implement interrupts for such fake gpio?
We would still need to pool this register periodically to check if state
changed.
Only if we use interrupts we can eliminate need of timers in cec module.

If I'm wrong please explain this a little more. :)

BTW. There is second line HPD (Hot-Plug-Detect) that has very similar
interface as CEC. How this will be handled in HDMI driver?

Jarek

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to