linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v2] v4l: rcar-fcp: Read IP version register at probe time
Date: Fri, 16 Aug 2019 10:21:42 +0200	[thread overview]
Message-ID: <CAMuHMdWnnWTgnrjbSSxkg1rUadosijZyrfB8LQk5zWhzmg3WtQ@mail.gmail.com> (raw)
In-Reply-To: <20190814145417.30670-1-laurent.pinchart+renesas@ideasonboard.com>

Hi Laurent,

On Wed, Aug 14, 2019 at 4:55 PM Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:
> This helps identifying the IP core version, for debugging purpose only
> for now.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> --- a/drivers/media/platform/rcar-fcp.c
> +++ b/drivers/media/platform/rcar-fcp.c

> @@ -138,6 +167,18 @@ static int rcar_fcp_probe(struct platform_device *pdev)
>
>         pm_runtime_enable(&pdev->dev);
>
> +       fcp->iomem = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(fcp->iomem))
> +               return PTR_ERR(fcp->iomem);
> +
> +       pm_runtime_get_sync(&pdev->dev);
> +       version = rcar_fcp_read(fcp, FCP_VCR);
> +       pm_runtime_put(&pdev->dev);

Unless (dynamic) debugging is enabled, all of the above is done for obtaining
a version number that is not used.
Can this be improved?

> +
> +       dev_dbg(&pdev->dev, "FCP category %u revision %u\n",
> +               (version & FCP_VCR_CATEGORY_MASK) >> FCP_VCR_CATEGORY_SHIFT,
> +               (version & FCP_VCR_REVISION_MASK) >> FCP_VCR_REVISION_SHIFT);
> +
>         mutex_lock(&fcp_lock);
>         list_add_tail(&fcp->list, &fcp_devices);
>         mutex_unlock(&fcp_lock);

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2019-08-16  8:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 14:54 [PATCH v2] v4l: rcar-fcp: Read IP version register at probe time Laurent Pinchart
2019-08-16  8:07 ` Kieran Bingham
2019-08-16 12:34   ` Laurent Pinchart
2019-08-16  8:21 ` Geert Uytterhoeven [this message]
2019-08-16 12:44   ` Laurent Pinchart

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=CAMuHMdWnnWTgnrjbSSxkg1rUadosijZyrfB8LQk5zWhzmg3WtQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.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).