Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4490607rdb; Tue, 12 Dec 2023 00:22:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHkJahoRowZDawWbGZjTR+TKOU+V90xGFtkgniBWbGZns4KoUU3PYHPbL0kWxX9YPMhNwIS X-Received: by 2002:a05:6a20:7488:b0:187:20e1:eefc with SMTP id p8-20020a056a20748800b0018720e1eefcmr2822999pzd.17.1702369339662; Tue, 12 Dec 2023 00:22:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702369339; cv=none; d=google.com; s=arc-20160816; b=VzUEN8NvQCqn4BxkrdoGUumCpLBZQLbpgLsOB+wac9JqxvxdFgpUnHzFESxNQidKgV si1hrHDI8+7hqQkyxNiaEDGipxYeDbVYBxzq0jk9U9ty/rlJ35zYMQrSxERlHIS8p7Eh 9Vc3VRs/3aYlrzp8R/tfNvbq+/GQlEO+EiuzqkWgPktyQHpCvCEloD8SP/XiYyib8udX qVXRyRM6J6jkmqd7VTvneyRsdNZykF+qrhu2uD2t3IS0XLv4aQZM7R0XGmJ2N26VwMfO yEZ7qXD2qqcSGO3iM2YGcEr1yfCBvsvBKrKbhdx/cQh8JvJw6XALcIPGypVysINkmgd7 xeuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=IpGrx2xxG9NN1yreUr4F4CtAzIIvGuyTj4pADMvGBAg=; fh=lcMz+iDkHQ2AzmxsqPpOwtAVzI3sU5FyWGbXShUbkLQ=; b=J+UZkojZfY3tbPTimUiAwHb8wPWPrJW7jl4SruaF27cIFsHbJJUeDDZZNtKR1uxvoq lj1oLn4gz7LvVhIZeFHN4yruRJE+qwTdWiWel5YyNgPzD0ceemscTbY3dxdtMAOiDQ8U 2TdYymWW4gFN2gwWjavro6J9b6o35LbogKEit9wS9ST1YXr4nfJzO40sRP5Cbvsxknxt gUMhm0epHPUUigGgsbxAC6gsg5+qmhf5pe6uWpeko1n1X7PcT2trkpVLrBKvlyGI/ITr rWtjH120FQRXvNJz9AMOwCs4oGAxKdvBIe1+OUTzNYPaPrc0XdC9QdrFdoX9ezrBQC0Q oUYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dQQRaAQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a18-20020a17090acb9200b00288272f936csi8819853pju.32.2023.12.12.00.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 00:22:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dQQRaAQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 24A528043999; Tue, 12 Dec 2023 00:22:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345948AbjLLIV7 (ORCPT + 99 others); Tue, 12 Dec 2023 03:21:59 -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: 7bit 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: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Dec 2023 00:22:14 -0800 (PST) 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/ep93xx.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 struct platform_device; +struct regmap; + +enum ep93xx_soc_model { + EP93XX_9301_SOC, + EP93XX_9307_SOC, + EP93XX_9312_SOC +}; + +#include +#include +#include +#include #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 +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); -- 2.41.0