Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1281266lqh; Mon, 6 May 2024 02:52:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsY0zHta//yW+V3g1JsMWuoptjR1A0JDM7nfSlVpq2QEgJc02x2kB9On1NggrF6DGdq9cBzYWNeT1ZeGdB3Egx8pBcgv/nm9yTKNoHzw== X-Google-Smtp-Source: AGHT+IFjYLj4TVcoZv0NDtja4WP3h20cjTFaS+oNT3Imv4uxvcv0bOI2zTHGDgjss358l6SBEZGP X-Received: by 2002:a05:6a20:dd88:b0:1aa:590a:9668 with SMTP id kw8-20020a056a20dd8800b001aa590a9668mr7534881pzb.51.1714989139857; Mon, 06 May 2024 02:52:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714989139; cv=pass; d=google.com; s=arc-20160816; b=X3XZVr5cFTxiizr5E4zDDK7HZkH7RKWfsnVAHQMHmWOfEf+s2nUhVhFuE68qvyla/Y JKdaxE/gYXdZIg8t7xKSlyJY6f9UHJViIQO7BW6l+BIB5sTMWjIgSaNyHbvVhOyRrwV/ Ke0yufbeVSbp8NA6sj/cUet3K/0k9yJrzFOpx8CupgreoU+I0bvDM/J44v1upagtLo5F cmuBPtAFQ5RzWtt5PqaMKD5GPO5S9Tby2J/3u7GeZxZ0Fk4r5iChxLdqZHAYOH/yAj6B A0CH5Wo3OYwhdf3qrMFahyx9iCdx/QFaC8OYmXmNatGyM+TUzpNZa2gx69HSVItZQ6ad nrXQ== 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=IdGKpcqxJ4UCmKYoIifqDYHL3POyccsqfTQpkh1zCN4=; fh=mybq7tpzq6JoVoMMHnsHHfUpqIDX99zshjW5ffzbbIc=; b=nyvpZX9tZqyv/X8xcXYmcTFLjdU6Hzx7pRjjKOZgtXu6jSjl8/3XbN8yzWFpNL/xEc tmoXmy+tUVFeTzSEhkHeW4Mq77KdVv2dGbEQg45OOuRmk9IQEmfMqaIPaeLcNPRvDDPb 7jlQ3N3NaKuT0DBiXe7Qxo6oGdczMAzMWQ97wkLGgb6UDt3hn4kZkTYtVN8L5dGEP/Ar x3n3JA5oNRsvtAS/fsC5+bXpy/OQx6iRZ5SnveM6Ss/i6yiZdqZnZLpexoBm+oJz8H93 xA6VFA3Us3jqJ2z86RnA1m0oahoWACuImbUcNjYCRn5BhIkdAj5wpG37IWdfxM0PU5lq HkhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fAL6gvQ6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169609-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. [139.178.88.99]) by mx.google.com with ESMTPS id i10-20020a170902e48a00b001eb0f1a4014si7748898ple.244.2024.05.06.02.52.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fAL6gvQ6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169609-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 5EC1D281B40 for ; Mon, 6 May 2024 09:52:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0644114533C; Mon, 6 May 2024 09:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fAL6gvQ6" 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 0C92F1428F1; Mon, 6 May 2024 09:49:49 +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=1714988990; cv=none; b=UhG7tEhQqtUZqjuHYu2InG+G5F0KfSpljn+1u8wrQBW/AiRjIaQv17H3UryHT6ieaWEsNTCFkgZt9hvhknpFPMrYikUMKo3EIobrNq/N/NgiAZ2Ftm+lnnq0iMr9NANrUbADWOVUvigKoDkJ3Vka24W78lwumcQKE/Wd1ZbnNUE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714988990; c=relaxed/simple; bh=MaaPz/uVBSgOz0414tAOXag61hG+3FxUKeQJ2X/omo4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SxEszUw31KxjHc5YkaKbQGNzMDW2sGOdu8vY3gPzNcaEGJaROFdiUyziDQgor+TmHnCzjba644mcpz0LAafnAJxfVMhcEslZCJbM/b//wZHCk0ytGqwcWxSLbY4Of12+RaUgn9YQxSoZ6KhkdnseFaoNQUdUtiiN8NBCC2jaE6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fAL6gvQ6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 8D0E1C4AF63; Mon, 6 May 2024 09:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714988989; bh=MaaPz/uVBSgOz0414tAOXag61hG+3FxUKeQJ2X/omo4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=fAL6gvQ6pfg9yxrkK7wPsuzaE5xkkabaL3anIEgc8qLt7N9AJd81rgetbjUQHOd5J 2LifBqOgtLz/koF/BdGK+rUYM7M7YZxK0Pep+cKlJ6cdziM0zA9NJqqJvF9fFPrrzS RjLnj8OX5EfIAe3vdvIsnlk2IVMzCfdRaZpS/fizng2kQtK+c+Td4So3/8h+9E3rc4 OHd9aCySlm/UdcPV7vTBVOVL6oeUf5gAmKB7YNGV8qDY+kr2M8vs6jrcjQ40tTw9zS aJJnxXFe29XpS/1iM/P/ptGexg15wCKJFKNDKLRvRheJbQQt7fak9CKkU0XtbRfjIu WHbOT2X9nB3mQ== 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 7B1F0C25B5F; Mon, 6 May 2024 09:49:49 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Mon, 06 May 2024 12:49:48 +0300 Subject: [PATCH RESEND v2 1/4] 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: <20240408-ep93xx-clk-v2-1-adcd68c13753@maquefel.me> References: <20240408-ep93xx-clk-v2-0-adcd68c13753@maquefel.me> In-Reply-To: <20240408-ep93xx-clk-v2-0-adcd68c13753@maquefel.me> To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexander Sverdlin Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Nikita Shubin , Arnd Bergmann , Linus Walleij X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714988988; l=1982; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=WN2FKVS9xdOOC9UEV7iQOB/IuHcF3+VzCPA/Q1z8yUU=; b=JiQz5KgMKadJfJijHF+8Kvkh76EWNZKytrRq2eH4ugCw2nJIUYD2wkDRWlLNwsEdS3Ca5j1BcMMd 3VS5v/Z7AZf45BrnPvsbMy72e9/TC/V5f4WF5u/ERtIgIo0Hok/N 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. Signed-off-by: Nikita Shubin Tested-by: Alexander Sverdlin Reviewed-by: Linus Walleij Reviewed-by: Stephen Boyd --- 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