All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca@lucaceresoli.net>
To: Sakari Ailus <sakari.ailus@iki.fi>
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 v4 6/8] media: imx274: add helper function to fill a reg_8 table chunk
Date: Wed, 27 Jun 2018 10:13:12 +0200	[thread overview]
Message-ID: <fb7bb663-0708-8271-8f4a-fff906c7babc@lucaceresoli.net> (raw)
In-Reply-To: <20180626122053.gd5jmt2wr35s5oh2@valkosipuli.retiisi.org.uk>

Hi Sakari,

On 26/06/2018 14:20, Sakari Ailus wrote:
> Hi Luca,
> 
> On Mon, Jun 11, 2018 at 01:35:37PM +0200, Luca Ceresoli wrote:
>> Tables of struct reg_8 are used to simplify multi-byte register
>> assignment. However filling these snippets with values computed at
>> runtime is currently implemented by very similar functions doing the
>> needed shift & mask manipulation.
>>
>> Replace all those functions with a unique helper function to fill
>> reg_8 tables in a simple and clean way.
> 
> What's the purpose of writing these registers as multiple I²C writes, when
> this can be done as a single write (i.e. the address followed by two or
> three octets of data)?

Good point. The for loops applying the register values (the lines just
after those changed by my patch) defuse the regmap bulk write capability.

I guess this could be improved not filling any table, but directly
calling regmap_bulk_write(), passing the u16 or u32 register value with
proper endianness. No tables, less code. This would replace the present
patch with a shorter and more effective one. Is it what you was suggesting?

I'll try that.
-- 
Luca

  reply	other threads:[~2018-06-27  9:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 11:35 [PATCH v4 0/8] media: imx274: cleanups, improvements and SELECTION API support Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 1/8] media: imx274: initialize format before v4l2 controls Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 2/8] media: imx274: consolidate per-mode data in imx274_frmfmt Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 3/8] media: imx274: get rid of mode_index Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 4/8] media: imx274: actually use IMX274_DEFAULT_MODE Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 5/8] media: imx274: simplify imx274_write_table() Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 6/8] media: imx274: add helper function to fill a reg_8 table chunk Luca Ceresoli
2018-06-26 12:20   ` Sakari Ailus
2018-06-27  8:13     ` Luca Ceresoli [this message]
2018-06-27  9:30       ` Sakari Ailus
2018-06-27  9:50         ` Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 7/8] media: imx274: fix typo Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 8/8] media: imx274: add SELECTION support for cropping Luca Ceresoli
2018-06-29  8:04   ` Sakari Ailus
2018-06-29  9:21     ` Luca Ceresoli
2018-06-26 12:19 ` [PATCH v4 0/8] media: imx274: cleanups, improvements and SELECTION API support Sakari Ailus
2018-06-26 21:15   ` Luca Ceresoli

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=fb7bb663-0708-8271-8f4a-fff906c7babc@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=sakari.ailus@iki.fi \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.