Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp949331rdf; Wed, 22 Nov 2023 01:02:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGD9ga1KBKauqZAPwoj9a6HUp2agCGplwfhLtxfm64ehuS6ljPY9F/WNH4Bw4xXqqBlnqQP X-Received: by 2002:a17:902:dad1:b0:1cf:56e1:ba98 with SMTP id q17-20020a170902dad100b001cf56e1ba98mr1673014plx.18.1700643744648; Wed, 22 Nov 2023 01:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700643744; cv=none; d=google.com; s=arc-20160816; b=n5YzoG4PubOAZLTPEh81BT1k1nNiIHbMCldSPLV+Dg6HZ2QzZ0u9nVEL3c/r4Xsn+2 Dp9bVxnEXviVnpkMHblGKxaTcUJVcwFctiaasjfqJ9wPeoSWz/CQ65swCtgHvZHrxpTP X23tAuICFd1t1PLW82hIrNEp6RzeZWEAbTmYBz0BW/yV3fIigBu1sie1FD498eCI1Nw2 OlUboiOin3j9zHGv+f92AU6EsWM+ftbVceJxfKh51lypFGy9gpJ+vUOV/HxM60vvSdyb KMTp4PiWJcxAdhCEHk8DY7uXEZpBe6A4a/9MhoPgGanfzFy/Xn5obLbExTne49F0cfih bjoQ== 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=GxKUrsSIcCezZRlFe42qg9+H/plDIheeLfpz6mceyxs=; b=IVs8MnVrFxFVPh1oxQe+2MU4IHHcnS/Kr9QJ8Wo0UD5m/65jGIntGQEe+NQ/yQAL3J 1r5CEJzWcoKjQ5sK/DZUIwT3uey/FmMEH0y7suOohJtB2W04kkoECHNJlvdyYlbzmXDz wSI/1+n6uYeG80Rm1QdyEyTGm+lC1soYK23KJjoTpp2tM6pJgLn9Ro0AOlIF0mKpuGnj VXxzwfPxuO2KlAiwZ60JDqOFgXfteLTiglg/hUp3xs3Fyibx9HIVN+PF4k4XqyHWR673 XmaYkBKxsyMIbjD+g0/HggYw9mkTaGI9vr80JD/atfWpkgVy1Yp7ELP6FmrcibUwx27i zQiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N4JDBQY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f21-20020a170902e99500b001c9dfd47959si11750455plb.602.2023.11.22.01.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 01:02:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N4JDBQY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id CA842810835D; Wed, 22 Nov 2023 01:01:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235067AbjKVJBT (ORCPT + 99 others); Wed, 22 Nov 2023 04:01:19 -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: 7bit 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: 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 01:01:48 -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