linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Andrey Smirnov <andrey.smirnov@convergeddevices.net>
Cc: hverkuil@xs4all.nl, mchehab@redhat.com, sameo@linux.intel.com,
	perex@perex.cz, tiwai@suse.de, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/6] Add the main bulk of core driver for SI476x code
Date: Sat, 27 Oct 2012 22:31:12 +0100	[thread overview]
Message-ID: <20121027213108.GD4564@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <5089BC7A.80103@convergeddevices.net>

[-- Attachment #1: Type: text/plain, Size: 2210 bytes --]

On Thu, Oct 25, 2012 at 03:26:02PM -0700, Andrey Smirnov wrote:
> On 10/25/2012 12:45 PM, Mark Brown wrote:

> > This really makes little sense to me, why are you doing this?  Does the
> > device *really* layer a byte stream on top of I2C for sending messages
> > that look like marshalled register reads and writes?

> The SI476x chips has a concept of a "property". Each property having
> 16-bit address and 16-bit value. At least a portion of a chip
> configuration is done by modifying those properties. In order to

Right, that's what I remembered from previous code.  There's no way this
should be a regmap bus - a bus is something that gets data serialised by
the core into a byte stream, having the data rendered down into a byte
stream and then reparsing it is a bit silly.  The device should be
hooking in before the data gets marshalled which we can't currently do
but it shouldn't be too hard to make it so that we can have register
read and write functions supplied in the regmap config.

> Also due to the way the driver uses the chip it is only powered up when
> the corresponding file in devfs(e.g. /dev/radio0) is opened at least by
> one user which means that unless there is a user who opened the file all
> the SET/GET_PROPERTY commands sent to it will be lost. The codec driver
> for that chip does not have any say in the power management policy(while
> all the audio configuration is done via "properties") if the chip is not
> powered up the driver has to cache the configuration values it has so
> that they can be applied later.

This is very normal, indeed modern CODEC drivers can leave the chip
powered down whenever it's not performing some function.

> So, since I have to implement a caching functionality in the driver, in
> order to avoid reinventing the wheel I opted for using 'regmap' API for
> this.

> Of course, It is possible that I misunderstood the purpose and
> capabilities of the 'regmap' framework, which would make my code look
> very silly indeed. If that is the case I'll just re-implement it using
> some sort of ad-hoc version of caching.

No, what you're doing is totally sensible.  It needs a bit of extension
to the framework before you can do it though.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-10-27 21:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 18:44 [PATCH v3 0/6] Driver for Si476x series of chips Andrey Smirnov
2012-10-23 18:44 ` [PATCH v3 1/6] Add header files and Kbuild plumbing for SI476x MFD core Andrey Smirnov
2012-10-23 22:56   ` Joe Perches
2012-10-23 18:44 ` [PATCH v3 2/6] Add the main bulk of core driver for SI476x code Andrey Smirnov
2012-10-25 19:45   ` Mark Brown
2012-10-25 22:26     ` Andrey Smirnov
2012-10-27 21:31       ` Mark Brown [this message]
2012-11-16 14:35   ` Hans Verkuil
2012-10-23 18:44 ` [PATCH v3 3/6] Add commands abstraction layer for SI476X MFD Andrey Smirnov
2012-10-23 18:44 ` [PATCH v3 4/6] Add chip properties handling code " Andrey Smirnov
2012-10-23 18:44 ` [PATCH v3 5/6] Add a V4L2 driver " Andrey Smirnov
2012-11-16 15:02   ` Hans Verkuil
2012-11-23 22:04     ` Andrey Smirnov
2012-11-16 22:22   ` Alexey Klimov
2012-10-23 18:44 ` [PATCH v3 6/6] Add a codec " Andrey Smirnov
2012-10-23 19:24   ` Mark Brown
2012-10-23 20:09     ` Andrey Smirnov
2013-02-11 22:39 ` [PATCH v3 0/6] Driver for Si476x series of chips Alexey Klimov

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=20121027213108.GD4564@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=andrey.smirnov@convergeddevices.net \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=perex@perex.cz \
    --cc=sameo@linux.intel.com \
    --cc=tiwai@suse.de \
    /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).