linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@linaro.org>
To: John Stultz <jstultz@google.com>
Cc: linux-kernel@vger.kernel.org,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Amit Pundir <amit.pundir@linaro.org>,
	Peter Collingbourne <pcc@google.com>,
	Vinod Koul <vkoul@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	kernel-team@android.com
Subject: Re: [RFC][PATCH 1/2] drm/bridge: lt9611: Consolidate detection logic
Date: Mon, 2 May 2022 16:26:05 +0200	[thread overview]
Message-ID: <CAG3jFyurX5MKDr9=kEFT6AaV+HZf588cAMLaBG8G+6CAr-3QJQ@mail.gmail.com> (raw)
In-Reply-To: <20220430064828.2470989-1-jstultz@google.com>

On Sat, 30 Apr 2022 at 08:48, John Stultz <jstultz@google.com> wrote:
>
> This patch simply consolidates the duplicated detection
> functionality in the driver.
>
> Cc: Yongqin Liu <yongqin.liu@linaro.org>
> Cc: Amit Pundir <amit.pundir@linaro.org>
> Cc: Peter Collingbourne <pcc@google.com>
> Cc: Vinod Koul <vkoul@kernel.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: kernel-team@android.com
> Signed-off-by: John Stultz <jstultz@google.com>
> ---
>  drivers/gpu/drm/bridge/lontium-lt9611.c | 22 ++++++++--------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c
> index 63df2e8a8abc..bf66af668f61 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt9611.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c
> @@ -578,10 +578,8 @@ static struct lt9611_mode *lt9611_find_mode(const struct drm_display_mode *mode)
>  }
>
>  /* connector funcs */
> -static enum drm_connector_status
> -lt9611_connector_detect(struct drm_connector *connector, bool force)
> +static enum drm_connector_status __lt9611_detect(struct lt9611 *lt9611)
>  {
> -       struct lt9611 *lt9611 = connector_to_lt9611(connector);
>         unsigned int reg_val = 0;
>         int connected = 0;
>
> @@ -594,6 +592,12 @@ lt9611_connector_detect(struct drm_connector *connector, bool force)
>         return lt9611->status;
>  }
>
> +static enum drm_connector_status
> +lt9611_connector_detect(struct drm_connector *connector, bool force)
> +{
> +       return __lt9611_detect(connector_to_lt9611(connector));
> +}
> +
>  static int lt9611_read_edid(struct lt9611 *lt9611)
>  {
>         unsigned int temp;
> @@ -887,17 +891,7 @@ static void lt9611_bridge_mode_set(struct drm_bridge *bridge,
>
>  static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge)
>  {
> -       struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
> -       unsigned int reg_val = 0;
> -       int connected;
> -
> -       regmap_read(lt9611->regmap, 0x825e, &reg_val);
> -       connected  = reg_val & BIT(0);
> -
> -       lt9611->status = connected ?  connector_status_connected :
> -                               connector_status_disconnected;
> -
> -       return lt9611->status;
> +       return __lt9611_detect(bridge_to_lt9611(bridge));
>  }
>
>  static struct edid *lt9611_bridge_get_edid(struct drm_bridge *bridge,

I think this looks good. Thank John!

Reviewed-by: Robert Foss <robert.foss@linaro.org>

      parent reply	other threads:[~2022-05-02 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30  6:48 [RFC][PATCH 1/2] drm/bridge: lt9611: Consolidate detection logic John Stultz
2022-04-30  6:48 ` [RFC][PATCH 2/2] drm/bridge: lt9611: Use both bits for HDMI sensing John Stultz
2022-05-02 14:26 ` Robert Foss [this message]

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='CAG3jFyurX5MKDr9=kEFT6AaV+HZf588cAMLaBG8G+6CAr-3QJQ@mail.gmail.com' \
    --to=robert.foss@linaro.org \
    --cc=amit.pundir@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=jstultz@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pcc@google.com \
    --cc=vkoul@kernel.org \
    --cc=yongqin.liu@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).