Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1155153rbb; Sun, 25 Feb 2024 23:42:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXq+ulsYM80SWY8yfdoQs6FIEQFdBLzEkdUh481lSpyLtCL+AS6KqMTb7bmiPDgjNtbf6jqUqTYC+chqknihjLBBtO6Dw0iWEKJS3x9xw== X-Google-Smtp-Source: AGHT+IEwp0EvRVsk2TNRWNWKLGAL2nPXfzXFDrRz9HmdKH31+Z5vS8Si7/rLX5IzMgqUYwXBXkXn X-Received: by 2002:a05:6a20:af87:b0:1a0:7e2f:ad44 with SMTP id ds7-20020a056a20af8700b001a07e2fad44mr6892123pzb.31.1708933329166; Sun, 25 Feb 2024 23:42:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708933329; cv=pass; d=google.com; s=arc-20160816; b=JaAEBoGPvOi3FSV40r1RuiHkN8b8iUsU7DaQ1MuMMkM1ZmJzrlSppWQH/Kro3FqkHS yKkxCcUGjLaWc1MzIzPilM+KV19eW4F0SEWwnuxMTukTQVX707Z/tvQZc52PqwBl2ZVI ZkYcNmlZgH1Jse2CPCaPBwh434Rkdu1Tbj/lcI0WUY3ybS4w/riSnRiHu8KKFgoKs4Xg L5xRcB0qwD4QTc1JN2L+hLn2dLXpNIA0RqGI80iH8ZpEbt2Y8S/gOf67CmDxLovP5Fhk muZbP4JKSu6oVd6JiooSj+FR30yP5TAOMW0aOHhrGxxLgamMwyBs7S6f6bu2K1yqn9X/ vNYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=9yy9SFmalWpqonZCSgMg6z7ZD+wZ9sGLklPRWeJ37vI=; fh=TTUJd6phijsff96igyJDpZdWPgAXjUnDZmO6QniFba8=; b=VJVhoWBsYYhIHx+4DxQW2UtqST9C7c8M7/eOsSa3wO6kzuqDDUC+Nr5AbWWqiZLwqe D9tnc8jyzrWZ/Vy1pm6KNajf9Bd2gzEMDc6FhvDyebezM14fDNlHAJENW2JVTDozCPUG blGRr6fUsKy98GZZ7Nx5fdSkeIMor+2SiVP1xkCuNVptb7s21piX46wa7Q9dsSvJb2e+ SO5JQLu3B/M3Aa0OauAWRurA/ZledFBJtjA//uGnq/JmHl78qT4ZT72kaIewNMzU4vC2 Z5GIqdbq8xoKuMcs4Vf26P8Rm4KgIVfP4Qnx4ks8fO/IkMVqf2WHhXgqn52G0iRks3L4 6luA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cAbuOUmH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id sj15-20020a17090b2d8f00b0029aa7f16b40si2652080pjb.25.2024.02.25.23.42.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 23:42:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cAbuOUmH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 65A3B28389C for ; Mon, 26 Feb 2024 07:32:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EFBC1CAAC; Mon, 26 Feb 2024 07:31:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cAbuOUmH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20BE31BDE6 for ; Mon, 26 Feb 2024 07:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708932682; cv=none; b=ftd4lpNoKb7rXXgpBC8hmch6/vhtfkCLHR2uJ2opDO0doV+52MN49inXv77x2UDZG9MsFbsM5DjGZZEplHe9cSt45e1NZUU2hklESh+Rlfcca4aHhsH9DtS5wsOnLWj8gSe6KMQfuAlcKqgWIJfMCn5alpboDTp8wq63NSpP6NY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708932682; c=relaxed/simple; bh=ufkbGUAlYUoKulI00K9+ehWHAATX13BMFcYZ+siKI5o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PlYxOXtSSudcyE7qjAdaZic34cUls6cFoJ6dgzwo22RTaSZrmWpZnFXnSQU+SxInRSTgQfR7swUVKjo3Qo15wH46pfR885b4ldmx4PdhysB4dEJq0Og+uYPjEsseLqFxC9acDCqvolovfUJFPE7stRBSAgDM9KQJducALpkDdGo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cAbuOUmH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id BD13FC43394; Mon, 26 Feb 2024 07:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708932681; bh=ufkbGUAlYUoKulI00K9+ehWHAATX13BMFcYZ+siKI5o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=cAbuOUmHTAP+4f51xPbOUxMd639TljHnVyHiB6J3p8oVreplHyUn8D9S7o8rVTDtw undfub15lW7LpXCuC7OB8HgZTQ7yGclN2LS5TQ9DxddXe9Ep4iTQ3gFDCGtF0g+X5q fumQqWkT4/OcvKEZGyeogKYiImj51grCiVYm8iXtsNDsTKr2jj1gPg/SO9M093gyAN pt8xlyHTT4SEOHxWVsy/evQlwhIQQS3wc4KLWoBVjMr44JfGBpjVLREQYejyFe7BIE 1BCur4yN6nWnDLkKWTJJ37SGO8hWkYFWSdvZevIbHQoIypW6hVIIBU8oOjYfl+Zx5y 5qgQzvcxPWYiQ== 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 A1D83C54E4A; Mon, 26 Feb 2024 07:31:21 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Mon, 26 Feb 2024 10:29:58 +0300 Subject: [PATCH v8 02/38] ARM: ep93xx: add regmap aux_dev Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240226-ep93xx-v8-2-3136dca7238f@maquefel.me> References: <20240226-ep93xx-v8-0-3136dca7238f@maquefel.me> In-Reply-To: <20240226-ep93xx-v8-0-3136dca7238f@maquefel.me> To: Nikita Shubin , Linus Walleij , Sergey Shtylyov , Damien Le Moal , Thierry Reding Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Dmitry Torokhov , linux-kernel@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.13-dev-e3e53 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708932678; l=1819; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=EhQQyDo+EFlJ9/0Xh2mELcKKDmANhg1EW47ZiNjCdIA=; =?utf-8?q?b=3DY/wJhJdBka7A?= =?utf-8?q?LmdNlgr1QmMZ84oAa6Z4CKmE0L+2lz4nfS82zov/TioZIAnfoHpLmVlO1gXNF9Sn?= vJUOd+zeCQxZjc5T28Yi7rX8FVrWB2vNuV+X+ZPBKaFUX4Rn4WmU 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: 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..a27447971302 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; +struct spinlock_t; + +enum ep93xx_soc_model { + EP93XX_9301_SOC, + EP93XX_9307_SOC, + EP93XX_9312_SOC, +}; + +#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