From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Satish Nagireddy <satish.nagireddy@getcruise.com>,
Matti Vaittinen <mazziesaccount@gmail.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 7/9] media: i2c: ds90ub953: Restructure clkout management
Date: Tue, 1 Aug 2023 16:53:19 +0300 [thread overview]
Message-ID: <ZMkOTwLHdRQqUtBg@smile.fi.intel.com> (raw)
In-Reply-To: <20230731-fpdlink-additions-v3-7-8acfc49c215a@ideasonboard.com>
On Mon, Jul 31, 2023 at 04:24:41PM +0300, Tomi Valkeinen wrote:
> Separate clkout calculations and register writes into two functions:
> ub953_calc_clkout_params and ub953_write_clkout_regs, and add a struct
> ub953_clkout_data that is used to store the clkout parameters.
>
> This simplifies the clkout management.
...
> +#define UB953_DEFAULT_CLKOUT_RATE 25000000UL
HZ_PER_MHZ (from units.h)?
...
> +struct ub953_clkout_data {
> + u32 hs_div;
> + u32 m;
> + u32 n;
> + unsigned long rate;
You may save 4 bytes on some architectures (which do not allow 4-byte alignment
for 64-bit members) by reshuffling the members.
(besides using u32-fract :-)
> +};
...
> + dev_dbg(dev, "%s %llu * %u / (8 * %u) = %lu (requested %lu)",
> + __func__, fc_rate, m, n, clkout_rate, target_rate);
__func__ in dev_dbg() is not needed. It's very rare nowadays to debug a kernel
without Dynamic Debug to be on.
...
> + dev_dbg(dev, "%s %llu / %u * %u / %u = %lu (requested %lu)",
> + __func__, fc_rate, hs_div, m, n, clkout_rate,
> + target_rate);
Ditto.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-08-01 13:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 13:24 [PATCH v3 0/9] media: i2c: ds90ub9xx: Misc improvements Tomi Valkeinen
2023-07-31 13:24 ` [PATCH v3 1/9] media: i2c: ds90ub9x3: Fix sub-device matching Tomi Valkeinen
2023-07-31 14:43 ` Laurent Pinchart
2023-07-31 19:05 ` Sakari Ailus
2023-07-31 13:24 ` [PATCH v3 2/9] media: i2c: ds90ub960: Configure CSI-2 continuous clock Tomi Valkeinen
2023-07-31 13:24 ` [PATCH v3 3/9] media: i2c: ds90ub953: Use v4l2_fwnode_endpoint_parse() Tomi Valkeinen
2023-07-31 13:24 ` [PATCH v3 4/9] media: i2c: ds90ub913: " Tomi Valkeinen
2023-07-31 13:24 ` [PATCH v3 5/9] media: i2c: ds90ub953: Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK Tomi Valkeinen
2023-07-31 13:24 ` [PATCH v3 6/9] media: i2c: ds90ub960: Allow FPD-Link async mode Tomi Valkeinen
2023-07-31 13:24 ` [PATCH v3 7/9] media: i2c: ds90ub953: Restructure clkout management Tomi Valkeinen
2023-08-01 13:53 ` Andy Shevchenko [this message]
2023-07-31 13:24 ` [PATCH v3 8/9] media: i2c: ds90ub953: Support non-sync mode Tomi Valkeinen
2023-07-31 13:24 ` [PATCH v3 9/9] media: i2c: ds90ub960: Rename RXPORT_MODE_CSI2_ASYNC to RXPORT_MODE_CSI2_NONSYNC Tomi Valkeinen
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=ZMkOTwLHdRQqUtBg@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=mazziesaccount@gmail.com \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=satish.nagireddy@getcruise.com \
--cc=tomi.valkeinen@ideasonboard.com \
/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