Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp200826rdb; Thu, 18 Jan 2024 00:25:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRyLfibTahVTwOfCk0zDbsx5v3QjFGjTA61A601QbUH/xmjaVekzocAMpDkFJ5NJ99ZLin X-Received: by 2002:ac8:58c5:0:b0:429:cadb:54c0 with SMTP id u5-20020ac858c5000000b00429cadb54c0mr423072qta.70.1705566312056; Thu, 18 Jan 2024 00:25:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705566312; cv=pass; d=google.com; s=arc-20160816; b=Eu7CXIhuuxb7iw1Q9vyG49O7t3U3zLtCaZfOWs/qt1c7OwmYUJQfpaDv+u6XwfgndF AoQ8r5avaPeA1d1X4estHL+z7REyNn/bXYeb/i7e9UiECgKLYc1b2nZL1qFRim2zasq3 dJsKtPFvJk6wa0oxz5TO5BR9XlGGw7qn/5GnLYeQ8BcrhvNT1Gh/AW9qqyC9qf5w7Jpr bjYxoici+q7CUjO3Y68pGUAGvypnGFliKl608TwLEqtHcaU4ahRHyrsTaq3C2LyMLL1o 129Q48ZCsDI43sDlOZSc1VDy95AkvAImXgSWqcE8AOruOIDEUjT03E8+EEblEDUpIeg9 x8lw== 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=AwP64NXiL8wXJJtnjYfe25fOQ3hC4n1ohPnjl+CRsuE=; b=n+TNs8KrCPhTccqD9vpJlyb3nNhpRVSli3tY6NfcWlUyuxBD0bm2OIruWOIq2uuvRt 27XXVidG+/90UUHhgmCbU1ta4Q58yLwlLAU5GKI3+2TzcHIbir38en1AQKvu7VSJHZ3n 5w9z1DoKp8ThWMbUysrDUFp0pwYmmDXOHn9frPYk8TTMlsSuks5g/4PhyDiAtOb1Fr0U zmKqOn4PFJRvoDXIqFzK8CKMaBlfwUR/lPea8a5lN8FMMQTdZbp68V1Fkwn02fRgv8qf wCKt3lk3+yF5gshCva6UcnpOOiLHZ/0jSBumbjSeGl0wfu/TX1YM+rR9qVPJYmuAfyIe idBQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LVsgB30R; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-29854-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29854-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c5-20020ac87dc5000000b0042a0274862dsi4894000qte.610.2024.01.18.00.25.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 00:25:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29854-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LVsgB30R; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-29854-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29854-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CC7711C20BB5 for ; Thu, 18 Jan 2024 08:25:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4C5325750; Thu, 18 Jan 2024 08:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LVsgB30R" 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 9EF2A125A3 for ; Thu, 18 Jan 2024 08:22:59 +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=1705566179; cv=none; b=mSeK79sp1nT1BekiDIE5bj2cKjnj4rtysC39hgilFr6knOGleUiFrL/Us/dyf63d4GQfvkaERE1lLkW08fUB7tVWC0xvwIV7g50bFcPzOLWw6LjzAgxwbFhz7gl2oXLU/6V5+e69xTQ06I61x5LZxDDCFV+fpCQz74fXdOEaTEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705566179; c=relaxed/simple; bh=ufkbGUAlYUoKulI00K9+ehWHAATX13BMFcYZ+siKI5o=; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; b=YVqwW6qOr3dtgPiwWomCBAN5arhdbYozWZuP4OPRtFXBcmkFl2db1t6owP34r7tR29is2xTAOxO61XqQckBgHWPmpob9OR3zydDV28OWTh+juSX7dJoErtzgB2jNDfq4UmwoQaJTJNZeDCABm3a0rsokJmOKKPIfV2Hbq/Lnlxk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LVsgB30R; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id D0F49C433A6; Thu, 18 Jan 2024 08:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705566178; bh=ufkbGUAlYUoKulI00K9+ehWHAATX13BMFcYZ+siKI5o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LVsgB30Rs4k/g8lTRr3Bx7DP2BdAev1+nNsMJjLdIYt8dM/qkGM1ptxN1gXWdpzWK bBZE4jDUgtDM4mv1PMAyBscwuzQZjcS+/SgNmuthHd0sJqzcCk6wzvZ/BjGwRjt/zR Yd9RRJh63p1PicoRoEpYj+LaZNAr4V2R6lptU/OHO3gBS93xyiv9JsizqufM7Vp6qM rYM21A/9sNMgLn2NJVkA7Vw22J8fuYIx6rjVCJPmKABWg9YR6T3j2cBUhu/XVvXHfF PgLMKeT2vyDWY3oquugaaygRkJYz4Y+8f615DClh34GURGPEYhRco4tKpVaFxOz2Hw vOb/c8Crrc4Qw== 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 AF380C47DB3; Thu, 18 Jan 2024 08:22:58 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Thu, 18 Jan 2024 11:20:46 +0300 Subject: [PATCH v7 03/39] 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: <20240118-ep93xx-v7-3-d953846ae771@maquefel.me> References: <20240118-ep93xx-v7-0-d953846ae771@maquefel.me> In-Reply-To: <20240118-ep93xx-v7-0-d953846ae771@maquefel.me> To: Nikita Shubin , Linus Walleij , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Thierry Reding , Damien Le Moal Cc: Dmitry Torokhov , Andy Shevchenko , linux-kernel@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.13-dev-e3e53 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705566176; l=1819; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=EhQQyDo+EFlJ9/0Xh2mELcKKDmANhg1EW47ZiNjCdIA=; =?utf-8?q?b=3DE6mRSgNvPmux?= =?utf-8?q?KDYv+fc89qi4gemQqIax5JCWJPYE+X8b8IfgXmftnh4ql40RyTC8LFZnMAkREsde?= T/3IuT4IB6FyzHm0WBsH/ZOmD38DvrqDo1J4JorTxTRMzkTTXyoB 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