From nobody Wed Dec 17 22:45:39 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DFC8C61D9C for ; Wed, 22 Nov 2023 09:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235085AbjKVJBV (ORCPT ); Wed, 22 Nov 2023 04:01:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbjKVJBS (ORCPT ); Wed, 22 Nov 2023 04:01:18 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C89F29E for ; Wed, 22 Nov 2023 01:01:14 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPS id 6B987C433CB; Wed, 22 Nov 2023 09:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700643674; bh=buzcRXUjCLmwedxDWvwtpshNY+cYB6kdPqYugv3vjOY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=N4JDBQY+9vV8aIZV2Ksrs7YgDpGtI8ArhSN6fx9DHiwhdJG3vwnOcgZK+xmY5ZfpD D0VhyYadD+wXVjB6LrxpCrn3sZiHlcKqJUsNgDqiiaD2Q/jExrl9Lnk6xATh+4OfnX l1j1vFibCdLZZ/kMOlycYF0k3IEQmUloQN6zKGI0fs7io/iBk8eeKwNS77KWX9gTjq JRUuwgVtvDS/28Fcx4B6WN/oWMIBddyDcB9ayb/PQ0mPRIbAbymwTAlzkX/PznVXCN CAbmeE1seLm7k9wR/5FDXlThU/ay4/PeXWHELmPhCQPf1rxGqM1VbpSTvR2D2XEttK jyLD6gwa6FtIA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FDBCC61D92; Wed, 22 Nov 2023 09:01:14 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Wed, 22 Nov 2023 11:59:40 +0300 Subject: [PATCH v5 02/39] ARM: ep93xx: add regmap aux_dev MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231122-ep93xx-v5-2-d59a76d5df29@maquefel.me> References: <20231122-ep93xx-v5-0-d59a76d5df29@maquefel.me> In-Reply-To: <20231122-ep93xx-v5-0-d59a76d5df29@maquefel.me> To: Nikita Shubin , Linus Walleij , Sergey Shtylyov , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Dmitry Torokhov Cc: Thierry Reding , linux-kernel@vger.kernel.org, Alexander Sverdlin X-Mailer: b4 0.13-dev-e3e53 X-Developer-Signature: v=1; a=ed25519-sha256; t=1700643671; l=1827; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=eYKSe0rCshZoOeVwRz9I1FuWVPyqzS0/nTRbTMhj8wM=; =?utf-8?q?b=3D1NCkQhAMeyih?= =?utf-8?q?z2DGqitjtrwHr/EEzZziOtRCOguyrbpaLM1CRbTOXBnxZeSsgPGL+SIiaiGelKFQ?= NDz62adMBDY9GLV2XngKqyrLQ8ohOLC/qgYb9KxH5gDz1XKSzzxK X-Developer-Key: i=nikita.shubin@maquefel.me; a=ed25519; pk=vqf5YIUJ7BJv3EJFaNNxWZgGuMgDH6rwufTLflwU9ac= X-Endpoint-Received: by B4 Relay for nikita.shubin@maquefel.me/20230718 with auth_id=65 X-Original-From: Nikita Shubin Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikita Shubin The following driver's should be instantiated by ep93xx syscon driver: - reboot - pinctrl - clock They all require access to DEVCFG register with a shared lock held, to avoid conflict writing to swlocked parts of DEVCFG. Provide common resources such as base, regmap and spinlock via auxiliary bus framework. Signed-off-by: Nikita Shubin --- include/linux/soc/cirrus/ep93xx.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/linux/soc/cirrus/ep93xx.h b/include/linux/soc/cirrus/e= p93xx.h index 56fbe2dc59b1..fc35be3af723 100644 --- a/include/linux/soc/cirrus/ep93xx.h +++ b/include/linux/soc/cirrus/ep93xx.h @@ -3,6 +3,18 @@ #define _SOC_EP93XX_H =20 struct platform_device; +struct regmap; + +enum ep93xx_soc_model { + EP93XX_9301_SOC, + EP93XX_9307_SOC, + EP93XX_9312_SOC +}; + +#include +#include +#include +#include =20 #define EP93XX_CHIP_REV_D0 3 #define EP93XX_CHIP_REV_D1 4 @@ -10,6 +22,20 @@ struct platform_device; #define EP93XX_CHIP_REV_E1 6 #define EP93XX_CHIP_REV_E2 7 =20 +struct ep93xx_regmap_adev { + struct auxiliary_device adev; + struct regmap *map; + void __iomem *base; + spinlock_t *lock; + void (*write)(struct regmap *map, spinlock_t *lock, unsigned int reg, + unsigned int val); + void (*update_bits)(struct regmap *map, spinlock_t *lock, + unsigned int reg, unsigned int mask, unsigned int val); +}; + +#define to_ep93xx_regmap_adev(_adev) \ + container_of((_adev), struct ep93xx_regmap_adev, adev) + #ifdef CONFIG_ARCH_EP93XX int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); void ep93xx_pwm_release_gpio(struct platform_device *pdev); --=20 2.41.0