From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753533AbbBBOal (ORCPT ); Mon, 2 Feb 2015 09:30:41 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:37834 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750840AbbBBOaj (ORCPT ); Mon, 2 Feb 2015 09:30:39 -0500 Message-ID: <54CF89EA.9040206@roeck-us.net> Date: Mon, 02 Feb 2015 06:30:02 -0800 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Mark Brown , Lars-Peter Clausen CC: Robert Rosengren , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jean Delvare Subject: Re: [PATCH] regmap: Fix i2c word access when using SMBus access functions References: <1422834481-6936-1-git-send-email-linux@roeck-us.net> <54CF50CF.7040601@metafoo.de> <20150202115638.GK21293@sirena.org.uk> In-Reply-To: <20150202115638.GK21293@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020202.54CF8A0D.021F,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 3 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/2015 03:56 AM, Mark Brown wrote: > On Mon, Feb 02, 2015 at 11:26:23AM +0100, Lars-Peter Clausen wrote: >> On 02/02/2015 12:48 AM, Guenter Roeck wrote: > >>> - return ®map_smbus_word; >>> + if (config->val_format_endian == REGMAP_ENDIAN_LITTLE) > >> This should probably use regmap_get_val_endian() and maybe also handle >> REGMAP_ENDIAN_NATIVE. > That means I'll have to make the function global and pass NULL as bus argument, which ultimately means that it is going to return either config->val_format_endian or REGMAP_ENDIAN_BIG. I didn't do that because I thought it has no value, but no problem. > Yes, we really ought to handle _NATIVE too (though the chances of it > being used with I2C are minimal, it's mostly for MMIO). This also feels Well, we do; it is handled similar to the big endian case with the current code. Do you think it should be handled differently ? If yes, how ? > like it's something that should be being handled further up the stack in > the serialization code but given that there's direct functions for this > in the smbus code perhaps it's better here. Or perhaps the smbus > support ought to be transitioned to use the bus interface and set > reg_write() and reg_read() operations now that we can do that, it seems > like a better fit though it might break compatibility with wierd devices. > I thought about that, but since the smbus functions perform endianness conversion it would mean that I would have to undo that conversion just to have it done again. Thanks, Guenter