From nobody Tue Feb 10 11:12:42 2026 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 5B6AEC4332F for ; Tue, 12 Dec 2023 08:22:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346012AbjLLIWA (ORCPT ); Tue, 12 Dec 2023 03:22:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbjLLIV6 (ORCPT ); Tue, 12 Dec 2023 03:21:58 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A631D2 for ; Tue, 12 Dec 2023 00:22:05 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPS id B4D6CC433CC; Tue, 12 Dec 2023 08:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702369324; bh=buzcRXUjCLmwedxDWvwtpshNY+cYB6kdPqYugv3vjOY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dQQRaAQTR1hQn4slnBWX2AsGKEzqMNmsgs1Qju1mr5D4Yh/fO3DNbRuy0IiG2ALQ4 KmsxRvqHQ6cnrHYWUwTs+MZpBeLSGbum5E8sTksJdgNhWONXINSHwV4rnLJn0Gsf/G +JYFwI1gJiNfJY/RCaJwJC/rG+JDI9+P8LcyLaU3ZRmbSEDkR0JAy5Vx9aBnymrqsN SdXKO9A7u1bwshXJXEESOyp5LOVFZMaFjOZKe1gA7zpjfLNQAPUlpfkpKVNtc/IKIH I0ikASV9OoICupk7PSQVRi/GMAF67FPgnbBITHg7x4D75fwVSHLwM2vShfQ3bZQllj cbmtGTmZbDv2g== 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 A0DA1C38145; Tue, 12 Dec 2023 08:22:04 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Tue, 12 Dec 2023 11:20:20 +0300 Subject: [PATCH v6 03/40] ARM: ep93xx: add regmap aux_dev MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231212-ep93xx-v6-3-c307b8ac9aa8@maquefel.me> References: <20231212-ep93xx-v6-0-c307b8ac9aa8@maquefel.me> In-Reply-To: <20231212-ep93xx-v6-0-c307b8ac9aa8@maquefel.me> To: Nikita Shubin , Linus Walleij , Dmitry Torokhov , Damien Le Moal , Andy Shevchenko Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.13-dev-e3e53 X-Developer-Signature: v=1; a=ed25519-sha256; t=1702369322; l=1827; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=eYKSe0rCshZoOeVwRz9I1FuWVPyqzS0/nTRbTMhj8wM=; =?utf-8?q?b=3D2ivmC5S5mStq?= =?utf-8?q?AgysB6XZ9bDah+Od6zlHy1pGhWoETzb3c6Xv/oMb7sSivgLKlgfLAHg8LaJt7ud9?= 9TAL8LM/BlGYVoS1YbbM/L7ZXLnDK0zTm17u8QNANmu89wN8oFot 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