Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755977AbaA2H0v (ORCPT ); Wed, 29 Jan 2014 02:26:51 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:30011 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbaA2H0t (ORCPT ); Wed, 29 Jan 2014 02:26:49 -0500 X-AuditID: cbfee691-b7efc6d0000039d3-c1-52e8ad360374 From: Jingoo Han To: "'Jenny Tc'" , "'Pavel Machek'" Cc: linux-kernel@vger.kernel.org, "'Dmitry Eremin-Solenikov'" , "'Anton Vorontsov'" , "'Anton Vorontsov'" , "'Kim Milo'" , "'Lee Jones'" , "'Chanwoo Choi'" , "'Sachin Kamat'" , "'Rupesh Kumar'" , "'Lars-Peter Clausen'" , "'Pali Roh?r'" , "'Mark Brown'" , "'Rhyland Klein'" , "'David Woodhouse'" , "'Tony Lindgren'" , "'Russell King'" , "'Sebastian Reichel'" , aaro.koskinen@iki.fi, freemangordon@abv.bg, linux-omap@vger.kernel.org, "'Jingoo Han'" References: <1390411194-21410-1-git-send-email-jenny.tc@intel.com> <1390411194-21410-5-git-send-email-jenny.tc@intel.com> <20140128141445.GC8713@xo-6d-61-c0.localdomain> <20140129132334.GB15355@jenny-desktop> In-reply-to: <20140129132334.GB15355@jenny-desktop> Subject: Re: [PATCH 4/4] power_supply: bq24261 charger driver Date: Wed, 29 Jan 2014 16:26:45 +0900 Message-id: <000001cf1cc3$7747ac20$65d70460$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac8cs1NXHko8P06gQ52n7tmqjCqiMgADvo0w Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA5WSaUhUURiGOXPv3FnQuI7b0YjC0MzS3D1imkXUpWhBiMIf6jhel3IZZjSi H2WZCOY2jqGOgfuSK43ilqaOiLiQ5ohabmSLGi4k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54idViyeT5rBb3vx5ltLi8 aw6bxewl/SwWty/zWiz/tY7FYuLp30wWd08dZbNYdnw1q8X7+bcYLU7+6WW0WP4pwmL/FS8H cY+j51+xerQ097B5fPs6icVj56y77B6Hvy5k8di8Qstj8Z6XTB53ru1h81jy5hCrR2/zOzaP lxN/s3nsPfSD3aNvyypGj+9L17B7HL+xncljxerv7AGCUQ2MNhmpiSmpRQqpecn5KZl56bZK 3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTnAkFBSKEvMKQUKBSQWFyvp22GaEBripmsB 0xih6xsSBNdjZIAGEtYxZvSc+slU0MhXsXkRTwPjSa4uRg4OCQETid1rFboYOYFMMYkL99az gdhCAtMZJaY3aHQxcgHZvxglDv5bB5ZgE1CT+PLlMDuILSLgJLH0431GkCJmgW1sEhdarzNC dFxjlNi5YCdYFaeAscSibRPBuoUFbCUWn94PFmcRUJW43reNCcTmBYqf6f/JBmELSvyYfI8F xGYW0JJYv/M4E4QtL7F5zVtmiKvVJR791YU4wkji5KleqBIRiX0v3jFOYBSahWTSLCSTZiGZ NAtJywJGllWMoqkFyQXFSem5hnrFibnFpXnpesn5uZsYwenxmdQOxpUNFocYBTgYlXh4V1x8 HiTEmlhWXJl7iFGCg1lJhFdg7osgId6UxMqq1KL8+KLSnNTiQ4zJQI9OZJYSTc4Hpu68knhD YxMzI0sjMwsjE3Nz0oSVxHkPtFoHCgmkJ5akZqemFqQWwWxh4uCUamBkuyaxvNm6uffbs96w /d0bWN1fedRMSjS/emGnctazmnVlJYqx66PzZhTUCvbz6TWdvr01LnqBw5mFQb7MMo7VjDvv bGh5V3x+cv42mYST6UourQdN9nAIi4g1Gy5/ub736YqDJvp7VnolSoT22q4Ov22nETpJaO5E R5GPf2KZptfNPeCz31WJpTgj0VCLuag4EQAurk7c0wMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, January 29, 2014 10:24 PM, Jenny Tc wrote: > On Tue, Jan 28, 2014 at 07:14:45AM -0700, Pavel Machek wrote: > > > +#define BQ24261_ICHRG_MASK (0x1F << 3) > > > +#define BQ24261_ICHRG_100ma (0x01 << 3) > > > +#define BQ24261_ICHRG_200ma (0x01 << 4) > > > +#define BQ24261_ICHRG_400ma (0x01 << 5) > > > +#define BQ24261_ICHRG_800ma (0x01 << 6) > > > +#define BQ24261_ICHRG_1600ma (0x01 << 7) > > > > First, its mA, not ma. > > Camel Case allowed? Ignore Checkpatch.pl warning? Yep, Camel Case is allowed by the commit d8b0771 "checkpatch: extend CamelCase types and ignore existing CamelCase uses in a patch". Thus, the following cases are currently allowed. #define BQ24261_ICHRG_1600ma (0x01 << 7) #define BQ24261_ICHRG_1600MA (0x01 << 7) #define BQ24261_ICHRG_1600mA (0x01 << 7) .... Best regards, Jingoo Han > > > +u16 bq24261_iterm[][2] = { > > > + {0, 0x00} > > > + , > > > + {50, BQ24261_ITERM_50ma} > > > + , > > > + {100, BQ24261_ITERM_100ma} > > > + , > > > + {150, BQ24261_ITERM_100ma | BQ24261_ITERM_50ma} > > > > ...this is very obscure way to do with table what can be done with > > > > (x/50) << 3, right ? > > Few register settings need table mapping, but some can have logic as your > comment say. Just wanted to keep same logic for all register settings. > Doesn't it make more readable? > > > > +u16 bq24261_cc[][2] = { > > > + > > > + {500, 0x00} > > > + , > > > + {600, BQ24261_ICHRG_100ma} > > > + , > > > + {700, BQ24261_ICHRG_200ma} > > > + , > > > + {800, BQ24261_ICHRG_100ma | BQ24261_ICHRG_200ma} > > > + , > > > + {900, BQ24261_ICHRG_400ma} > > > > I suspect you can get rid of this, too, if you expand macros. > Same as above comment. > > -Jenny -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/