Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3196591lqp; Tue, 26 Mar 2024 02:22:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWP+zqh6uH4RJdWS6Dp5+BpfSXUWJYd0OMiZsGJ4cFwX7MHH8XEpAL0kShSbHqJfZWNos/EL4qS9oKmtgWoEjNhus6TviSqV3JWwjALNQ== X-Google-Smtp-Source: AGHT+IHk+ouj5opHSC4jQA0ZHIomrugCsIqpoWf8iJJmKC5HzjaAvK/lgQqEvXo8LAL5o6Pewp92 X-Received: by 2002:a17:906:6d44:b0:a45:40e4:8c8 with SMTP id a4-20020a1709066d4400b00a4540e408c8mr711332ejt.16.1711444959594; Tue, 26 Mar 2024 02:22:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711444959; cv=pass; d=google.com; s=arc-20160816; b=SZDZgVR++EfNAznnz4h6uDEzIpEXnk1pXyJgdHbxBcuGSqyffhXrbYfV2VDRt0+w5E /YEBUiRGTLxJbbmio/qJxqjv+aH18d3mWmXTf3a7gev0659q7ZGoPVwxvgMrq7MQyHKA OogzbQa60MkTDJ15YhqaWqlw6rcVTrHbjb9UB87StAEDLA5C63FASpFJimjfeYhm824A ehrJuF5bckltTFPH7UBtibtf1LTymWq7s79m0SfnvdMRebgiERdGpDyQxV6hlFsGDkum vIlP4Rf6P+/DdSJoTlBLbTX4ENx00t/8jKDv0obiLH42lxLNY9gpubza52mquBLfHkIz T74A== 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=ziCp8yNZ6DdvfAot1mhRF2u4SZcU+XRsb82aXlPlTbo=; fh=h+/ShyorEwkDf7/X9qZUv8+wGST3CszEEx+6eXzqWzc=; b=WRyUkdoDNpH2Vq/YA+NPTlL+TzfOLb3sSpT+A4Xr35H25G2WDQum1pVfEIMvJjf+ud CXYd9JYDCP9B5oQbbzXaukAUanZ2fDP+KEMJjly7Knds4iHYATGjRVWnLQjXN9vgKW3n OLbdJ204VYpYaQyrSOHdM61nHmcgX+5Hg8wSN567GwbGOlsFsrUV5dAc/NjdIywLzz7Y q3xdzDGTDItgwT/xJBihsLmQwHFd3ZUAmeHvCrrr4eeyq0Z2/7r4nnAmklEmzZ/q1P9S zzroUrHrmrotMVfCg922F0sPC2zDP1emqvtcTbOxUcdjj8FsAlkYSxUPgj+N5VZ50yf8 sYXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vory76pu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bl22-20020a170906c25600b00a47484f15e9si2808561ejb.241.2024.03.26.02.22.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 02:22:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vory76pu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118637-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 820451F3BC03 for ; Tue, 26 Mar 2024 09:22:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA03D6F08B; Tue, 26 Mar 2024 09:20:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vory76pu" 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 9CB4254915 for ; Tue, 26 Mar 2024 09:20:41 +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=1711444841; cv=none; b=asdp6vARTmaPpo1UXeHgBagjMzaeFrp5oa5TzVnB0wr3sVKIhWopHZhTC2sOsSaGul0pa1mllVu1PIQ9R8+mGmI72uckx4SC+/4KgQTF/20Mycl6qaCCmtwHUY6OpyScQY+zBjY4EgYFrYF97JsCpH71pTtprUAkn2/5+z7X7kQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711444841; c=relaxed/simple; bh=iq2ih8Ipw3SxDksF8h2ZMhskuiJG/2xr+8MxfUqnio4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aHgYcF09W81Vd3dcBiHLTDUlDX7lbyxv6/s8zFjIWbkykGddbzYaKjOsfIHIvGkmebjBsShb6vECZeKBjItt2Z7H2+y4Pr3p+w5csX8SJvzjtWB9WOVpQu5vyZ+sPHrj2vHLPFySLxpOZHeJkqNTjs2esIX99adnPOSr9AouFt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vory76pu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 0CD80C43141; Tue, 26 Mar 2024 09:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711444841; bh=iq2ih8Ipw3SxDksF8h2ZMhskuiJG/2xr+8MxfUqnio4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Vory76puu/IyOmkMm4a8+2PubokiHUKqwKeqyCGrOdRexm0jFCmDc9XQ2jZZkfwt6 H20DeLw9aJcOzjHTNf4vm0ESUog1m307O3CpoYQhwvQVczog8/1i3b6u+yybM2ix0i Ojx8pqDFRszAYQh29kpIIoIuSt8X5JifxPv1sS6/ofWmct8N88cLaMCH+ngPkeeF1p DSbS/4wO8kEpO2CZ3WmDEURH+a9BEtEW8Oh6Um5PyUMclBxvG2dFkopkGujE51O6E+ jAv1w+EzfNH/DBPV4s7hFmXVqHMT0M47kZFqVEERxDfVK4zAif42P7ABLMDC7C6brR 9p6MGZ0LyRd2Q== 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 D9FA0C54E58; Tue, 26 Mar 2024 09:20:40 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Tue, 26 Mar 2024 12:18:29 +0300 Subject: [PATCH v9 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: <20240326-ep93xx-v9-2-156e2ae5dfc8@maquefel.me> References: <20240326-ep93xx-v9-0-156e2ae5dfc8@maquefel.me> In-Reply-To: <20240326-ep93xx-v9-0-156e2ae5dfc8@maquefel.me> To: Nikita Shubin , Linus Walleij , Sergey Shtylyov , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Thierry Reding Cc: 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=1711444837; l=1936; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=8GNQQ0FLPdUCDb0XBxpTXasuK4TcZUkX+2U0TBYz+4E=; b=3A5B3dDNnazG+fs9r7JAOULSa2qrvds1sBDjocOGZ5fiWVQXRO/6ibG1a3IVckJtNu5HOyD/Wzjz vC0OfCH/BBVT8KRIHDpWMYjsZFQpEix/liGBwefvoq+Ce0nbt3zt 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: nikita.shubin@maquefel.me 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. Tested-by: Alexander Sverdlin Reviewed-by: Linus Walleij 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