Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1193774lqe; Mon, 8 Apr 2024 01:12:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZyjVgbg+V3sHAwU6EAAnH3Ij0Z9CgAZFUnJA+QsiCIu7+PKiou99cjHRsI5DV9dwamJiq65MhDdp1rnBOfxizyRA7GtKcV2JMqFHo7w== X-Google-Smtp-Source: AGHT+IHctQtdvnQ1Z/h4LEPs7zs6HxWKBNmCfbofV9SLMj/3zWs78bLNc0D7F2E4g+Bqk/4b0I3R X-Received: by 2002:a50:f608:0:b0:568:aa14:37a9 with SMTP id c8-20020a50f608000000b00568aa1437a9mr6528423edn.24.1712563931696; Mon, 08 Apr 2024 01:12:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712563931; cv=pass; d=google.com; s=arc-20160816; b=pi5KgNDDYx0vFpEu1aYoSswTv4x+ziWH8OqSHOWTvk0GV+5n2QIhVbxwzlwmQQUo2Q 7i2MNUHB89kFDUTLE/8poxJPWSNSvfYytjTAdsDjy8zBVGNaP/91SKEtCyAP1KLa7ZPF 4Jzh/jeGfojckx3c0tZKap8nFmnu8UJruqsSMmH+h+Du0ZASuAh4fm1mlfVeN4uoeRPK g7a8hvEpxDnyZA0UvabOLknoo3I2VVuTxMUBMGnyzhAG3lmpWPoDcNcbOM5/EfvrujpE nvhiBQBvy1bmC3JsTROmmXHXQfXwqChb5vx/J8IPckYhyeHKmaOI557Bgjfwyk+dY7KG KOLQ== 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=2Aw2TBN6fHV7Z/YJmhOD8zdALNttaQ3F0OSEwu3LOIk=; fh=mybq7tpzq6JoVoMMHnsHHfUpqIDX99zshjW5ffzbbIc=; b=e5hN5MCgm3pGPXV/Wmd5EsIxVPJ+K3xqOvtp5OPoe1/YvrwQbPY1FfEHEm0fM/ZDDU 2jdMffwnoEDn2V9uzwmOyymY4orR85aGO2ulP4MGfNmIij33DZlHkSkaaZWU6JvuEos3 eItIcwuZoCdA2QiU4Dv8zypv0yyCaGFQcMVCoDxn9RWfc7SSzO+TiG4LldzZawMxcdxn Vu97UAKDsroJbxQRvWZkK8or7/YCiwHJIO0XgSSPN0Gwy7zJo4y0FAGRxxYOETSHxaFA MGeEJ7p4FWLHw12ISVS/tMceCrdDDxHyBkF7m2H+AfGyi7mVbeUTxHBrbWuzbCkZe9/K XmuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWvhSzR1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135004-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. [147.75.80.249]) by mx.google.com with ESMTPS id m2-20020a50d7c2000000b0056893d784f7si3347047edj.52.2024.04.08.01.12.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 01:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWvhSzR1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135004-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 6C3121F21245 for ; Mon, 8 Apr 2024 08:12:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A3604D10A; Mon, 8 Apr 2024 08:10:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FWvhSzR1" 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 41F2E47F7C; Mon, 8 Apr 2024 08:10:10 +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=1712563810; cv=none; b=qQ+iW7H//NeU2KBtpEa0mPb4NeMDrfVPy/7lbpEXDlcUofBBM24wYz8GzSGIbpDotDw9+R4lw51oIGQqQKrenrc0qc8Dy9QymEcxwF6USg7RhRPQfvd1nlAnO8sRY45zSX5J0ahgd28OYtdhRzOkXmAU7csWWFxstdx0UlLIHaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712563810; c=relaxed/simple; bh=Zfdfmw4YgP1HV3+xyjpGmpcpKBb4YOFB7O+xev3b2rE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Wfg9V89VZ59UqRv+4n9+JkYRLoayyJC3/aHtjzI36si+rV+F0dnU7tIBlwBkMGh2IUZjIhKLDDUrM6Vfg8xYkP8uqRKqnhDYZC3xIay9kMJzTCJThUUxj1zxP/v/6JAO786/yv2OEdxy0CevyV+5Jk2pDbyqdXAvGw3JEH6q79I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FWvhSzR1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id DA6F1C433B1; Mon, 8 Apr 2024 08:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712563809; bh=Zfdfmw4YgP1HV3+xyjpGmpcpKBb4YOFB7O+xev3b2rE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FWvhSzR1jtLLcHA2TQeU+vFcOpAxmji8gycNQrW7geWAPhehqQ4dbd0E3HXK4m+B/ Xm7b2eqt3ers5AsduDB7Qqb0wfBDP2usTMEtO0SdoVp+K+ssQeHCIFiaW60OqBWx2h /bzDvGFa4dnPkUI+1NTgkM+bZwWXx7cX09gn3V12bxkRlYZMCSM/nTHsdBJV2jKsw1 VC9NJH3HwiS+dqCXsXHal8MdmUFmNvsBgkznBmkkbVL5gFpe0ZhLAsKu7q6Nz63iqR FovPngUpA8QXjMI3a6YeZULL1Fs6ck3oS3hXNL94k5LYRrJTNmwRE8OKZNPYMLaozw l9SxVNieMHUaQ== 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 B7B95CD1292; Mon, 8 Apr 2024 08:10:09 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Mon, 08 Apr 2024 11:09:53 +0300 Subject: [PATCH 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-v1-1-1d0f4c324647@maquefel.me> References: <20240408-ep93xx-clk-v1-0-1d0f4c324647@maquefel.me> In-Reply-To: <20240408-ep93xx-clk-v1-0-1d0f4c324647@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=1712563809; l=1936; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=fGS9fJK3awLSzWpcMoPlPiB8iiGYJR/6Q3XZJdJ0Jqw=; b=dCM4n39WhbzN+OZDn/lZ7Zyvi/p3PBOxPXmWeNpKw8BHEqvvTAh2HRAEX7APt8aOiq+7FXds0CUX hpCD4Pj+Axm7SdVfWDrsIFGPtkytOrc7+lwXusHWm1IwdRMBY/0Y 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 --- 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