From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933154AbcLILBv (ORCPT ); Fri, 9 Dec 2016 06:01:51 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35087 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932245AbcLILBu (ORCPT ); Fri, 9 Dec 2016 06:01:50 -0500 Date: Fri, 9 Dec 2016 11:05:05 +0000 From: Lee Jones To: Chen-Yu Tsai Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 1/2] mfd: axp20x: Add address extension registers for AXP806 regmap Message-ID: <20161209110505.GK3625@dell.home> References: <20161123031616.10114-1-wens@csie.org> <20161123031616.10114-2-wens@csie.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20161123031616.10114-2-wens@csie.org> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Nov 2016, Chen-Yu Tsai wrote: > The AXP806 supports either master/standalone or slave mode. > Slave mode allows sharing the serial bus, even with multiple > AXP806 which all have the same hardware address. > > This is done with extra "serial interface address extension", > or AXP806_BUS_ADDR_EXT, and "register address extension", or > AXP806_REG_ADDR_EXT, registers. The former is read-only, with > 1 bit customizable at the factory, and 1 bit depending on the > state of an external pin. The latter is writable. Only when > the these device addressing bits (in the upper 4 bits of the > registers) match, will the device respond to operations on > its other registers. > > Add these 2 registers to the regmap so we can access them. > > Signed-off-by: Chen-Yu Tsai > --- > drivers/mfd/axp20x.c | 3 ++- > include/linux/mfd/axp20x.h | 2 ++ > 2 files changed, 4 insertions(+), 1 deletion(-) Applied for v4.11, thanks. > diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c > index ba130be32e61..cdaeb34a9a38 100644 > --- a/drivers/mfd/axp20x.c > +++ b/drivers/mfd/axp20x.c > @@ -135,6 +135,7 @@ static const struct regmap_range axp806_writeable_ranges[] = { > regmap_reg_range(AXP806_PWR_OUT_CTRL1, AXP806_CLDO3_V_CTRL), > regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ2_EN), > regmap_reg_range(AXP20X_IRQ1_STATE, AXP20X_IRQ2_STATE), > + regmap_reg_range(AXP806_REG_ADDR_EXT, AXP806_REG_ADDR_EXT), > }; > > static const struct regmap_range axp806_volatile_ranges[] = { > @@ -305,7 +306,7 @@ static const struct regmap_config axp806_regmap_config = { > .val_bits = 8, > .wr_table = &axp806_writeable_table, > .volatile_table = &axp806_volatile_table, > - .max_register = AXP806_VREF_TEMP_WARN_L, > + .max_register = AXP806_REG_ADDR_EXT, > .cache_type = REGCACHE_RBTREE, > }; > > diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h > index fec597fb34cb..7e85ececcedf 100644 > --- a/include/linux/mfd/axp20x.h > +++ b/include/linux/mfd/axp20x.h > @@ -115,6 +115,8 @@ enum { > #define AXP806_CLDO2_V_CTRL 0x25 > #define AXP806_CLDO3_V_CTRL 0x26 > #define AXP806_VREF_TEMP_WARN_L 0xf3 > +#define AXP806_BUS_ADDR_EXT 0xfe > +#define AXP806_REG_ADDR_EXT 0xff > > /* Interrupt */ > #define AXP152_IRQ1_EN 0x40 -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog