[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d37242b1-dace-15d2-e758-1f242dadfa09@linaro.org>
Date: Sat, 7 Oct 2017 11:25:22 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Jonathan Neuschäfer <j.neuschaefer@....net>
Cc: gregkh@...uxfoundation.org, broonie@...nel.org,
alsa-devel@...a-project.org, sdharia@...eaurora.org, bp@...e.de,
poeschel@...onage.de, treding@...dia.com,
gong.chen@...ux.intel.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,
kheitke@...ience.com, linux-arm-msm@...r.kernel.org, arnd@...db.de
Subject: Re: [Patch v6 6/7] regmap: add SLIMBUS support
Thanks for the review comments,
On 07/10/17 06:02, Jonathan Neuschäfer wrote:
> Hi,
>
> On Fri, Oct 06, 2017 at 05:51:35PM +0200, 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 *slim = context;
>> + struct slim_val_inf msg = {0,};
>> +
>> + msg.start_offset = reg;
>> + msg.num_bytes = 1;
>> + msg.rbuf = (void *)val;
>> +
>> + return slim_request_val_element(slim, &msg);
>> +}
>
> This looks like it won't work on big-endian systems. I know big endian
> is pretty uncommon in devices that will likely have SLIMBus, but it's
> better to be endian-independent.
Yep, I agree! will fix it in next version.
>
>> +static int regmap_slimbus_byte_reg_write(void *context, unsigned int reg,
>> + unsigned int val)
>> +{
>> + struct slim_device *slim = context;
>> + struct slim_val_inf msg = {0,};
>> +
>> + msg.start_offset = reg;
>> + msg.num_bytes = 1;
>> + msg.wbuf = (void *)&val;
>> +
>> + return slim_change_val_element(slim, &msg);
>> +}
>
> dito
>
>> +static struct regmap_bus regmap_slimbus_bus = {
>> + .reg_write = regmap_slimbus_byte_reg_write,
>> + .reg_read = regmap_slimbus_byte_reg_read,
>> +};
>
>
> Thanks,
> Jonathan Neuschäfer
>
Powered by blists - more mailing lists