[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171123074925.hk3omwaqkg7swwmw@localhost.localdomain>
Date: Thu, 23 Nov 2017 07:49:25 +0000
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: <srinivas.kandagatla@...aro.org>
CC: <gregkh@...uxfoundation.org>, <broonie@...nel.org>,
<alsa-devel@...a-project.org>, <sdharia@...eaurora.org>,
<bp@...e.de>, <poeschel@...onage.de>, <treding@...dia.com>,
<andreas.noever@...il.com>, <alan@...ux.intel.com>,
<mathieu.poirier@...aro.org>, <daniel@...ll.ch>, <jkosina@...e.cz>,
<sharon.dvir1@...l.huji.ac.il>, <joe@...ches.com>,
<davem@...emloft.net>, <james.hogan@...tec.com>,
<michael.opdenacker@...e-electrons.com>, <robh+dt@...nel.org>,
<pawel.moll@....com>, <mark.rutland@....com>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <vinod.koul@...el.com>,
<arnd@...db.de>
Subject: Re: [PATCH v7 08/13] regmap: add SLIMbus support
On Wed, Nov 15, 2017 at 02:10:38PM +0000, srinivas.kandagatla@...aro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
>
> This patch adds support to read/write slimbus value elements.
> Currently it only supports byte read/write. Adding this support in
> regmap would give codec drivers more flexibility when there are more
> than 2 control interfaces like slimbus, i2c.
>
> Without this patch each codec driver has to directly call slimbus value
> element apis, and this could would get messy once we want to add i2c
> interface to it.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> ---
> +
> +static int regmap_slimbus_byte_reg_read(void *context, unsigned int reg,
> + unsigned int *val)
> +{
> + struct slim_device *sdev = context;
> + int v;
> +
> + if (!sdev)
> + return 0;
Is there a specific reason we are checking the context here? The
other regmap buses don't both and whilst I don't mind checking
shouldn't we return an error if we don't have a context rather
than pretending to succeed?
> +
> + v = slim_readb(sdev, reg);
> +
> + if (v < 0)
> + return v;
> +
> + *val = v;
> +
> + return 0;
> +}
> +
> +static int regmap_slimbus_byte_reg_write(void *context, unsigned int reg,
> + unsigned int val)
> +{
> + struct slim_device *sdev = context;
> +
> + if (!sdev)
> + return 0;
ditto.
Thanks,
Charles
Powered by blists - more mailing lists