From: Jan Kotas <jank@cadence.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Jan Kotas <jank@cadence.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
Rafal Ciepiela <rafalc@cadence.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] media: Add support for Cadence CSI2RX 2.1
Date: Mon, 9 Sep 2019 09:24:15 +0000 [thread overview]
Message-ID: <A67221D2-8F92-4168-83D0-6B1325CA4417@global.cadence.com> (raw)
In-Reply-To: <20190906080119.GF1586@valkosipuli.retiisi.org.uk>
Hello Sakari,
Thanks for the review.
> On 6 Sep 2019, at 10:01, Sakari Ailus <sakari.ailus@iki.fi> wrote:
>
> Hi Jan,
>
> On Thu, Sep 05, 2019 at 11:56:01AM +0100, Jan Kotas wrote:
>> This patch adds support for CSI2RX v2.1 version of the controller.
>>
>> Signed-off-by: Jan Kotas <jank@cadence.com>
>> ---
>> drivers/media/platform/cadence/cdns-csi2rx.c | 139 ++++++++++++++++++++++-----
>> 1 file changed, 116 insertions(+), 23 deletions(-)
>>
>> struct csi2rx_priv {
>> struct device *dev;
>> unsigned int count;
>> @@ -69,6 +81,7 @@ struct csi2rx_priv {
>> struct clk *p_clk;
>> struct clk *pixel_clk[CSI2RX_STREAMS_MAX];
>> struct phy *dphy;
>> + struct csi2rx_vops *vops;
>
> const?
I’ll add it, thanks.
>>
>> u8 lanes[CSI2RX_LANES_MAX];
>> u8 num_lanes;
>> @@ -92,6 +105,32 @@ struct csi2rx_priv *v4l2_subdev_to_csi2rx(struct v4l2_subdev *subdev)
>> return container_of(subdev, struct csi2rx_priv, subdev);
>> }
>>
>> +static void csi2rx_get_dev_cfg(struct csi2rx_priv *csi2rx)
>> +{
>> + u32 dev_cfg;
>> +
>> + clk_prepare_enable(csi2rx->p_clk);
>> + dev_cfg = readl(csi2rx->base + CSI2RX_DEVICE_CFG_REG);
>> + clk_disable_unprepare(csi2rx->p_clk);
>> +
>> + csi2rx->max_lanes = dev_cfg & 7;
>> + csi2rx->max_streams = (dev_cfg >> 4) & 7;
>> + csi2rx->has_internal_dphy = dev_cfg & BIT(3) ? true : false;
>
> Could you spell out these a little, by adding #defines for the register
> bits? Same below.
I tried to keep impact on the original code to the minimum,
but you’re right. It’s a good opportunity for a cleanup.
>>
>> @@ -439,6 +535,9 @@ static int csi2rx_probe(struct platform_device *pdev)
>> csi2rx->dev = &pdev->dev;
>> mutex_init(&csi2rx->lock);
>>
>> + of_id = of_match_node(csi2rx_of_table, pdev->dev.of_node);
>> + csi2rx->vops = (struct csi2rx_vops *)of_id->data;
>
> The cast isn't needed, is it?
It’s not, but doesn’t make it more readable?
> --
> Kind regards,
>
> Sakari Ailus
Regards,
Jan
next prev parent reply other threads:[~2019-09-09 9:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 10:55 [PATCH v2 0/3] media: Add support for Cadence CSI2RX version 2.1 Jan Kotas
2019-09-05 10:55 ` [PATCH v2 1/3] media: dt-bindings: Update bindings for Cadence CSI2RX Jan Kotas
2019-09-17 20:52 ` Rob Herring
2019-09-05 10:56 ` [PATCH v2 2/3] media: Add lane checks " Jan Kotas
2019-09-06 7:54 ` Sakari Ailus
2019-09-09 7:41 ` Jan Kotas
2019-09-09 7:51 ` Sakari Ailus
2019-09-09 8:12 ` Jan Kotas
2019-09-09 9:40 ` Sakari Ailus
2019-09-05 10:56 ` [PATCH v2 3/3] media: Add support for Cadence CSI2RX 2.1 Jan Kotas
2019-09-06 8:01 ` Sakari Ailus
2019-09-09 9:24 ` Jan Kotas [this message]
2019-09-09 9:41 ` Sakari Ailus
2019-09-05 12:01 ` [PATCH v2 0/3] media: Add support for Cadence CSI2RX version 2.1 Maxime Ripard
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=A67221D2-8F92-4168-83D0-6B1325CA4417@global.cadence.com \
--to=jank@cadence.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maxime.ripard@bootlin.com \
--cc=mchehab@kernel.org \
--cc=rafalc@cadence.com \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@iki.fi \
/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).