All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/7] drm/i2c: tda998x: move CEC device initialisation later
Date: Tue, 12 Dec 2017 14:50:45 +0000	[thread overview]
Message-ID: <20171212145044.GA10595@n2100.armlinux.org.uk> (raw)
In-Reply-To: <a5cb5976-1ff3-de5f-14f6-18e6e00a61d5@xs4all.nl>

On Tue, Dec 12, 2017 at 03:37:21PM +0100, Hans Verkuil wrote:
> Hi Russell,
> 
> On 08/12/17 12:59, Russell King - ARM Linux wrote:
> > On Wed, Dec 06, 2017 at 02:54:04PM +0100, Hans Verkuil wrote:
> >> On 12/06/17 13:35, Russell King wrote:
> >>> We no longer use the CEC client to access the CEC part itself, so we can
> >>> move this later in the initialisation sequence.
> >>>
> >>> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> >>> ---
> >>>  drivers/gpu/drm/i2c/tda998x_drv.c | 7 ++++---
> >>>  1 file changed, 4 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
> >>> index 7f4dbca7f7f4..4aeac2127974 100644
> >>> --- a/drivers/gpu/drm/i2c/tda998x_drv.c
> >>> +++ b/drivers/gpu/drm/i2c/tda998x_drv.c
> >>> @@ -1490,9 +1490,6 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
> >>>  	priv->cec_addr = 0x34 + (client->addr & 0x03);
> >>>  	priv->current_page = 0xff;
> >>>  	priv->hdmi = client;
> >>> -	priv->cec = i2c_new_dummy(client->adapter, priv->cec_addr);
> >>> -	if (!priv->cec)
> >>> -		return -ENODEV;
> >>>  
> >>>  	/* wake up the device: */
> >>>  	cec_write(priv, REG_CEC_ENAMODS,
> >>> @@ -1546,6 +1543,10 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
> >>>  			CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL);
> >>>  
> >>>  	/* initialize the optional IRQ */
> >>> +	priv->cec = i2c_new_dummy(client->adapter, priv->cec_addr);
> >>> +	if (!priv->cec)
> >>> +		return -ENODEV;
> >>> +
> >>
> >> I'd move this up to before the 'initialize the optional IRQ' comment, since
> >> that should stay with the 'if (client->irq) {' line below.
> > 
> > I've swapped the order of patches 2 and 3, and moved this further down
> > near where we add the real cec device in a later patch.  This is
> > starting to get quite different from the patch series that I've tested,
> > and as I've already mentioned, testing is not going to happen for a
> > while.
> > 
> 
> I added support for this to am335x-boneblack-common.dtsi (see patch below), but
> it doesn't work. I suspect the calibration since I see these messages:
> 
> gpio-57 (nxp,calib): gpiod_direction_output: tried to set a GPIO tied to an IRQ as output

It's annoying that different gpiochips have different behaviours, it
means you can't develop a driver using gpios and know that it'll work
elsewhere.  It would be nice if everywhere behaved the same so that
could've been detected earlier.

> Which makes sense. I had a similar case in my cec-gpio driver and I had to completely
> free the interrupt before I could set the direction to output.
> 
> I do get nice interrupts when a transmit is done, so the interrupt works correctly.
> And it correctly detects Ack/Nack.
> 
> I looked a bit closer and I see that even without calibration the timings are reasonably
> OK: 2.3 ms for a bit period instead of the recommended 2.4 ms. Slightly off but within
> margins.
> 
> But receiving messages fails: I get no interrupt at all. Not sure if the lack of
> calibration is the cause of that, or if it is something else. I can take another look
> once the calibration is fixed.

Unfortuantely NXP don't document what the allowable tolerances are for
the chip.  I'd suggest getting the calibration working correctly would
be a good first step.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-12-12 14:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 12:34 [PATCH v2 0/7] TDA998x CEC support Russell King - ARM Linux
2017-12-06 12:35 ` [PATCH v2 1/7] drm/i2c: tda998x: move mutex/waitqueue/timer/work init early Russell King
2017-12-06 13:51   ` Hans Verkuil
2017-12-06 12:35 ` [PATCH v2 2/7] drm/i2c: tda998x: move CEC device initialisation later Russell King
2017-12-06 13:54   ` Hans Verkuil
2017-12-08 11:59     ` Russell King - ARM Linux
2017-12-12 14:37       ` Hans Verkuil
2017-12-12 14:50         ` Russell King - ARM Linux [this message]
2017-12-06 12:35 ` [PATCH v2 3/7] drm/i2c: tda998x: fix error cleanup paths Russell King
2017-12-06 13:55   ` Hans Verkuil
2017-12-06 12:35 ` [PATCH v2 4/7] drm/i2c: tda998x: always disable and clear interrupts at probe Russell King
2017-12-06 13:55   ` Hans Verkuil
2017-12-06 12:35 ` [PATCH v2 5/7] drm/i2c: tda9950: add CEC driver Russell King
2017-12-06 14:11   ` Hans Verkuil
2017-12-11 10:34     ` Russell King - ARM Linux
2017-12-06 12:35 ` [PATCH v2 6/7] drm/i2c: tda998x: add CEC support Russell King
2017-12-06 13:50   ` Hans Verkuil
2017-12-08 11:57     ` Russell King - ARM Linux
2017-12-08 12:14       ` Hans Verkuil
     [not found] ` <20171206123452.GA13127-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2017-12-06 12:35   ` [PATCH v2 7/7] dt-bindings: tda998x: add the calibration gpio Russell King
     [not found]     ` <E1eMYva-0004WA-Hf-eh5Bv4kxaXIk46pC+1QYvQNdhmdF6hFW@public.gmane.org>
2017-12-06 20:41       ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171212145044.GA10595@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hverkuil@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.