From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Wallner Date: Thu, 25 Jun 2020 15:36:16 +0200 Subject: [PATCH v1 17/43] x86: pinctrl: Add a way to get the pinctrl reg address In-Reply-To: <20200614215726.v1.17.I6d4adee5cfa6760f332c0a463658ab3167308689@changeid> References: <20200614215726.v1.17.I6d4adee5cfa6760f332c0a463658ab3167308689@changeid> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, -----"Simon Glass" schrieb: ----- > Betreff: [PATCH v1 17/43] x86: pinctrl: Add a way to get the pinctrl reg address > > At present we can query the offset of a pinctrl register within the p2sb. > For ACPI we need to get the actual address of the register. Add a function > to handle this and rename the old one to more accurately reflect its > purpose. > > Signed-off-by: Simon Glass > --- > > arch/x86/include/asm/intel_pinctrl.h | 16 ++++++++++++++-- > drivers/gpio/intel_gpio.c | 15 +++++++++++---- > drivers/misc/p2sb-uclass.c | 16 ++++++++-------- > drivers/pinctrl/intel/pinctrl.c | 11 +++++++++-- > include/p2sb.h | 9 +++++++++ > 5 files changed, 51 insertions(+), 16 deletions(-) > > diff --git a/arch/x86/include/asm/intel_pinctrl.h b/arch/x86/include/asm/intel_pinctrl.h > index e2524b089d..f39ebde539 100644 > --- a/arch/x86/include/asm/intel_pinctrl.h > +++ b/arch/x86/include/asm/intel_pinctrl.h > @@ -263,11 +263,23 @@ int pinctrl_read_pads(struct udevice *dev, ofnode node, const char *prop, > int pinctrl_count_pads(struct udevice *dev, u32 *pads, int size); > > /** > - * intel_pinctrl_get_config_reg_addr() - Get address of the pin config registers > + * intel_pinctrl_get_config_reg_offset() - Get offset of pin config registers > * > + * This works out the register offset of a pin within the p2sb region. > + * > + * @dev: Pinctrl device > + * @offset: GPIO offset within this device > + * @return register offset of first register within the GPIO p2sb region > + */ > +u32 intel_pinctrl_get_config_reg_offset(struct udevice *dev, uint offset); > + > +/** > + * intel_pinctrl_get_config_reg_offset() - Get address of pin config registers Copy/Paste error: intel_pinctrl_get_config_reg_addr() > + * > + * This works out the absolute address of the registers for a pin > * @dev: Pinctrl device > * @offset: GPIO offset within this device > - * @return register offset within the GPIO p2sb region > + * @return register offset of first register within the GPIO p2sb region Copy/Paste error: should be address, not offset > */ > u32 intel_pinctrl_get_config_reg_addr(struct udevice *dev, uint offset); [snip] Reviewed-by: Wolfgang Wallner