From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373Ab2HaLYH (ORCPT ); Fri, 31 Aug 2012 07:24:07 -0400 Received: from mailrelay1.diasemi.com ([82.210.246.133]:11957 "EHLO mailrelay1.diasemi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780Ab2HaLXc (ORCPT ); Fri, 31 Aug 2012 07:23:32 -0400 From: Krystian Garbaciak To: Mark Brown CC: , , , , , , Samuel Ortiz , Liam Girdwood , Mark Brown , Alessandro Zummo , Jean Delvare , Dmitry Torokhov , Ashish Jangam , Andrew Jones , Donggeun Kim , Philippe =?iso-8859-1?Q?R=E9tornaz?= , "Wim Van Sebroeck" , Bryan Wu , Richard Purdie , Anthony Olech References: <201208241445@sw-eng-lt-dc-vm2> <201208241450@sw-eng-lt-dc-vm2> <20120825183113.GE6520@opensource.wolfsonmicro.com> In-Reply-To: <20120825183113.GE6520@opensource.wolfsonmicro.com> Message-ID: <201208311220@sw-eng-lt-dc-vm2> Date: Fri, 31 Aug 2012 12:20:00 +0100 Subject: Re: [PATCH 1/8] mfd: Add Dialog DA906x core driver. Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Fri, Aug 24, 2012 at 02:50:00PM +0100, Krystian Garbaciak wrote: > > > This is MFD module providing access to registers and interrupts of DA906x > > series PMIC. It is used by other functional modules, registered as MFD cells. > > Driver uses regmap with paging to access extended register list. Register map > > is divided into two pages, where the second page is used during initialisation. > > Your selection of people to CC here appears both large and random... I've added any maintainer for my modules from maintainer list. > > +inline unsigned int da906x_to_range_reg(u16 reg) > > +{ > > + return reg + DA906X_MAPPING_BASE; > > +} > > I've no real idea what this stuff is all about, it at least needs some > comments somewhere. The fact that you're just adding a constant offset > to all registers is at best odd. I will comment it precisely for next version: +/* Adding virtual register range starting from address DA9063_MAPPING_BASE. + It will be used for registers requiring page switching, which in our case + are virtually all PMIC registers. + Registers from 0 to 255 are used only as a page window and are volatile, + except DA9063_REG_PAGE_CON register (page selector), which is cachable. */ +static const struct regmap_range_cfg da9063_range_cfg[] = { + { + .range_min = DA9063_MAPPING_BASE, + .range_max = DA9063_MAPPING_BASE + + ARRAY_SIZE(da9063_reg_flg) - 1, + .selector_reg = DA9063_REG_PAGE_CON, + .selector_mask = 1 << DA9063_I2C_PAGE_SEL_SHIFT, + .selector_shift = DA9063_I2C_PAGE_SEL_SHIFT, + .window_start = 0, + .window_len = 256, + } +}; .. and here: +/* Access to any PMIC register is passed through virtual register range, + starting at DA9063_MAPPING_BASE. For those registers, paging is required. */ +inline unsigned int da9063_to_range_reg(u16 reg) +{ + return reg + DA9063_MAPPING_BASE; +} From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krystian Garbaciak Subject: Re: [PATCH 1/8] mfd: Add Dialog DA906x core driver. Date: Fri, 31 Aug 2012 12:20:00 +0100 Message-ID: <201208311220@sw-eng-lt-dc-vm2> References: <201208241445@sw-eng-lt-dc-vm2> <201208241450@sw-eng-lt-dc-vm2> <20120825183113.GE6520@opensource.wolfsonmicro.com> Return-path: In-Reply-To: <20120825183113.GE6520@opensource.wolfsonmicro.com> Sender: linux-kernel-owner@vger.kernel.org Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, lm-sensors@lm-sensors.org, linux-input@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-leds@vger.kernel.org, Samuel Ortiz , Liam Girdwood , Mark Brown , Alessandro Zummo , Jean Delvare , Dmitry Torokhov , Ashish Jangam , Andrew Jones , Donggeun Kim , Philippe =?iso-8859-1?Q?R=E9tornaz?= , Wim Van Sebroeck , Bryan Wu , Richard Purdie , Anthony Olech List-Id: linux-input@vger.kernel.org > On Fri, Aug 24, 2012 at 02:50:00PM +0100, Krystian Garbaciak wrote: > > > This is MFD module providing access to registers and interrupts of DA906x > > series PMIC. It is used by other functional modules, registered as MFD cells. > > Driver uses regmap with paging to access extended register list. Register map > > is divided into two pages, where the second page is used during initialisation. > > Your selection of people to CC here appears both large and random... I've added any maintainer for my modules from maintainer list. > > +inline unsigned int da906x_to_range_reg(u16 reg) > > +{ > > + return reg + DA906X_MAPPING_BASE; > > +} > > I've no real idea what this stuff is all about, it at least needs some > comments somewhere. The fact that you're just adding a constant offset > to all registers is at best odd. I will comment it precisely for next version: +/* Adding virtual register range starting from address DA9063_MAPPING_BASE. + It will be used for registers requiring page switching, which in our case + are virtually all PMIC registers. + Registers from 0 to 255 are used only as a page window and are volatile, + except DA9063_REG_PAGE_CON register (page selector), which is cachable. */ +static const struct regmap_range_cfg da9063_range_cfg[] = { + { + .range_min = DA9063_MAPPING_BASE, + .range_max = DA9063_MAPPING_BASE + + ARRAY_SIZE(da9063_reg_flg) - 1, + .selector_reg = DA9063_REG_PAGE_CON, + .selector_mask = 1 << DA9063_I2C_PAGE_SEL_SHIFT, + .selector_shift = DA9063_I2C_PAGE_SEL_SHIFT, + .window_start = 0, + .window_len = 256, + } +}; .. and here: +/* Access to any PMIC register is passed through virtual register range, + starting at DA9063_MAPPING_BASE. For those registers, paging is required. */ +inline unsigned int da9063_to_range_reg(u16 reg) +{ + return reg + DA9063_MAPPING_BASE; +} From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krystian Garbaciak Date: Fri, 31 Aug 2012 11:20:00 +0000 Subject: Re: [lm-sensors] [PATCH 1/8] mfd: Add Dialog DA906x core driver. Message-Id: <201208311220@sw-eng-lt-dc-vm2> List-Id: References: <201208241445@sw-eng-lt-dc-vm2> <201208241450@sw-eng-lt-dc-vm2> <20120825183113.GE6520@opensource.wolfsonmicro.com> In-Reply-To: <20120825183113.GE6520@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mark Brown Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, lm-sensors@lm-sensors.org, linux-input@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-leds@vger.kernel.org, Samuel Ortiz , Liam Girdwood , Mark Brown , Alessandro Zummo , Jean Delvare , Dmitry Torokhov , Ashish Jangam , Andrew Jones , Donggeun Kim , Philippe =?iso-8859-1?Q?R=E9tornaz?= , Wim Van Sebroeck , Bryan Wu , Richard Purdie , Anthony Olech > On Fri, Aug 24, 2012 at 02:50:00PM +0100, Krystian Garbaciak wrote: > > > This is MFD module providing access to registers and interrupts of DA906x > > series PMIC. It is used by other functional modules, registered as MFD cells. > > Driver uses regmap with paging to access extended register list. Register map > > is divided into two pages, where the second page is used during initialisation. > > Your selection of people to CC here appears both large and random... I've added any maintainer for my modules from maintainer list. > > +inline unsigned int da906x_to_range_reg(u16 reg) > > +{ > > + return reg + DA906X_MAPPING_BASE; > > +} > > I've no real idea what this stuff is all about, it at least needs some > comments somewhere. The fact that you're just adding a constant offset > to all registers is at best odd. I will comment it precisely for next version: +/* Adding virtual register range starting from address DA9063_MAPPING_BASE. + It will be used for registers requiring page switching, which in our case + are virtually all PMIC registers. + Registers from 0 to 255 are used only as a page window and are volatile, + except DA9063_REG_PAGE_CON register (page selector), which is cachable. */ +static const struct regmap_range_cfg da9063_range_cfg[] = { + { + .range_min = DA9063_MAPPING_BASE, + .range_max = DA9063_MAPPING_BASE + + ARRAY_SIZE(da9063_reg_flg) - 1, + .selector_reg = DA9063_REG_PAGE_CON, + .selector_mask = 1 << DA9063_I2C_PAGE_SEL_SHIFT, + .selector_shift = DA9063_I2C_PAGE_SEL_SHIFT, + .window_start = 0, + .window_len = 256, + } +}; .. and here: +/* Access to any PMIC register is passed through virtual register range, + starting at DA9063_MAPPING_BASE. For those registers, paging is required. */ +inline unsigned int da9063_to_range_reg(u16 reg) +{ + return reg + DA9063_MAPPING_BASE; +} _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors