From: Luca Ceresoli <luca@lucaceresoli.net>
To: Philippe De Muyter <phdm@macq.eu>
Cc: linux-media@vger.kernel.org,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Leon Luo <leonl@leopardimaging.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 1/2] media: imx274: use regmap_bulk_write to write multybyte registers
Date: Tue, 28 Aug 2018 11:14:47 +0200 [thread overview]
Message-ID: <9ed69bb8-ff2c-76bb-faef-71c06e96877b@lucaceresoli.net> (raw)
In-Reply-To: <20180828090300.GA23579@frolo.macqel>
Hi Philippe,
thanks for you review.
On 28/08/2018 11:03, Philippe De Muyter wrote:
> On Wed, Jul 25, 2018 at 06:24:54PM +0200, Luca Ceresoli wrote:
>> Currently 2-bytes and 3-bytes registers are set by very similar
>> functions doing the needed shift & mask manipulation, followed by very
>> similar for loops setting one byte at a time over I2C.
>>
>> Replace all of this code by a unique helper function that calls
>> regmap_bulk_write(), which has two advantages:
>> - sets all the bytes in a unique I2C transaction
>> - removes lots of now unused code.
>>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
>>
> ...
>> +/**
>> + * Write a multibyte register.
>> + *
>> + * Uses a bulk write where possible.
>> + *
>> + * @priv: Pointer to device structure
>> + * @addr: Address of the LSB register. Other registers must be
>> + * consecutive, least-to-most significant.
>> + * @val: Value to be written to the register (cpu endianness)
>> + * @nbytes: Number of bits to write (range: [1..3])
>> + */
>> +static int imx274_write_mbreg(struct stimx274 *priv, u16 addr, u32 val,
>> + size_t nbytes)
>
> Should nbytes be called nbits, or is nbytes a 'Number of bytes' ?
This patch has already been applied, but I sent a fix:
https://patchwork.linuxtv.org/patch/51719/
--
Luca
next prev parent reply other threads:[~2018-08-28 9:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 16:24 [PATCH v6 0/2] media: imx274: cleanups, improvements and SELECTION API support Luca Ceresoli
2018-07-25 16:24 ` [PATCH v6 1/2] media: imx274: use regmap_bulk_write to write multybyte registers Luca Ceresoli
2018-08-28 9:03 ` Philippe De Muyter
2018-08-28 9:14 ` Luca Ceresoli [this message]
2018-07-25 16:24 ` [PATCH v6 2/2] media: imx274: add cropping support via SELECTION API Luca Ceresoli
2018-07-27 10:50 ` Sakari Ailus
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=9ed69bb8-ff2c-76bb-faef-71c06e96877b@lucaceresoli.net \
--to=luca@lucaceresoli.net \
--cc=leonl@leopardimaging.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=phdm@macq.eu \
--cc=sakari.ailus@linux.intel.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
all inboxes | Powered by JetHome®