[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALAqxLU+jo-F_8Q7n72CP5gQO1JhRiQZaWGSn=q57v9Ofiv8fg@mail.gmail.com>
Date: Tue, 28 Nov 2017 13:32:47 -0800
From: John Stultz <john.stultz@...aro.org>
To: Archit Taneja <architt@...eaurora.org>
Cc: Arnd Bergmann <arnd@...db.de>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
David Airlie <airlied@...ux.ie>,
Lars-Peter Clausen <lars@...afoo.de>,
Bhumika Goyal <bhumirks@...il.com>,
Inki Dae <inki.dae@...sung.com>,
dri-devel@...ts.freedesktop.org,
lkml <linux-kernel@...r.kernel.org>,
Xinliang Liu <xinliang.liu@...aro.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Sean Paul <seanpaul@...omium.org>,
Hans Verkuil <hans.verkuil@...co.com>,
Guodong Xu <guodong.xu@...aro.org>
Subject: Re: [RFC][PATCH] drm: adv7511/33: Fix adv7511_cec_init() failure handling
On Sun, Nov 26, 2017 at 4:56 AM, Archit Taneja <architt@...eaurora.org> wrote:
>
> On 11/17/2017 04:29 AM, John Stultz wrote:
>> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
>> b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
>> index 0e14f15..939c3b9 100644
>> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
>> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
>> @@ -1203,12 +1203,12 @@ static int adv7511_probe(struct i2c_client *i2c,
>> const struct i2c_device_id *id)
>> #ifdef CONFIG_DRM_I2C_ADV7511_CEC
>> ret = adv7511_cec_init(dev, adv7511, offset);
>> - if (ret)
>> - goto err_unregister_cec;
>> #else
>> - regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL + offset,
>> - ADV7511_CEC_CTRL_POWER_DOWN);
>> + ret = 1;
>> #endif
>> + if (ret)
>> + regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL +
>> offset,
>> + ADV7511_CEC_CTRL_POWER_DOWN);
>
>
> This would force CEC to be powered off even if adv7511_cec_init() returned
> 0, right?
I don't think so. The initent was its only powered off if
adv7511_cec_init returns an error or if CONFIG_DRM_I2C_ADV7511_CEC is
not set.
> Do we know why the call to adv7511_cec_init() is failing on the Hikey board?
> If it's
> because there isn't a "cec" clock specified in DT, it's not really a fatal
> error, it
> just means that the platform hasn't been set up to support CEC. In that
Yea. I believe this is the case w/ HiKey. I don't have deeply
detailed docs on the board so I'm not sure if we will be able to
enable that or not (Xinliang/Guodong: Do you know if its possible?).
In the meantime though, we shouldn't regress.
> case, we
> should just power down the CEC block. So, if adv7511_cec_init() would return
> a
> -ENOENT, which we could use as a hint to power down CEC. So, maybe something
> like this?:
>
> #ifdef CONFIG_DRM_I2C_ADV7511_CEC
> ret = adv7511_cec_init(dev, adv7511, offset);
> if (ret && ret != -ENOENT)
> goto err_unregister_cec;
> #endif
> if (ret)
> regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL + offset,
> ADV7511_CEC_CTRL_POWER_DOWN);
>
> Apart from this, we should also move adv7511_cec_init() up in the probe so
> that
> it's called before the drm_bridge is registered.
Hans has since reworked the patch w/ a new version. You might want to
check his patches and see if they fit what your imagining.
thanks
-john
Powered by blists - more mailing lists