Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7DD0C433FE for ; Mon, 28 Nov 2022 06:48:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9F7D84C36; Mon, 28 Nov 2022 07:48:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="J7FIKkLD"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Rszbh28f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1DA11830E9; Mon, 28 Nov 2022 07:48:03 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D0D7D8447C for ; Mon, 28 Nov 2022 07:48:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 168E55C00BD; Mon, 28 Nov 2022 01:48:00 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 28 Nov 2022 01:48:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669618080; x=1669704480; bh=Bb NSpp0gU9z2QMuCb364ATVoHr2tLfxceuDQsIGe1hc=; b=J7FIKkLDh8LJTbk7QV RhcVeS11PhzbXLQyItV2DXrEdbmQGTFt+WOzFLejwzOnJpLlOYkoDO/dNoZln2Wn Q3ELClXXd7qiGIi4LdQmlKD9Gfq/GxWXsMUmWOpNs191VS5HeGqpTgIPg5ELrvgV 5Qaui5GTE5xZid7qnBNiEYlJfWJqgmi/Z+PxQRgfAvgp1MjAS7SStl0CqR7YvLVC r6ezDFYQ7S50NuMeMN8+P8mWwBAVVh0zAhNz2Sdsma4tjwcWhd+5UokYNF5P9jvY cWUlmi/mjjPtHq1mKeRT/lCNeuuyravc82TId8NCy5SUu0+sBStwqLXWqsj0B1BU tOvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1669618080; x=1669704480; bh=BbNSpp0gU9z2Q MuCb364ATVoHr2tLfxceuDQsIGe1hc=; b=Rszbh28fipmNx62yIX5Dvk1v1H+sz yTWD+hzNbuGVUHGQjD9wz+sx6URXRk7pTa6bJ3Gc0nl2tb33j8gohpONRo+oNmRo 3yhKhkSwpYiRSeLIuTXO0GSWA2ClXTqspTQUdbKVlmjMzgYVFHWUhEH7snfaHJnJ luqrChwmIFxvYvaui4tS7lw1QiEXZ3wa5zp388vd5f8Ej49ocvionU7trG4Dl/na Qwq5QeJmlujLoYpWG1azXYuqsr6gSUulU19uuMH7QUjIQPF1LcRVEVHcxeIb8b0p pVFZzF7rkd5qfTdNiERl7VdTVNumcDJIRqdltfw6FHU2JoDRQPn2910RQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjedugddutddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Nov 2022 01:47:59 -0500 (EST) From: Samuel Holland To: Jaehoon Chung , Andre Przywara Cc: u-boot@lists.denx.de, Samuel Holland Subject: [PATCH 1/3] power: pmic: axp: Provide a variant ID in the driver data Date: Mon, 28 Nov 2022 00:47:54 -0600 Message-Id: <20221128064757.2933-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221128064757.2933-1-samuel@sholland.org> References: <20221128064757.2933-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Subordinate regulator drivers can use this enumerated ID instead of matching the compatible string again. Signed-off-by: Samuel Holland --- drivers/power/pmic/axp.c | 18 +++++++++--------- include/axp_pmic.h | 12 ++++++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/power/pmic/axp.c b/drivers/power/pmic/axp.c index 0f2b24a8b5f..e0005994e21 100644 --- a/drivers/power/pmic/axp.c +++ b/drivers/power/pmic/axp.c @@ -64,15 +64,15 @@ static int axp_pmic_bind(struct udevice *dev) } static const struct udevice_id axp_pmic_ids[] = { - { .compatible = "x-powers,axp152" }, - { .compatible = "x-powers,axp202" }, - { .compatible = "x-powers,axp209" }, - { .compatible = "x-powers,axp221" }, - { .compatible = "x-powers,axp223" }, - { .compatible = "x-powers,axp803" }, - { .compatible = "x-powers,axp806" }, - { .compatible = "x-powers,axp809" }, - { .compatible = "x-powers,axp813" }, + { .compatible = "x-powers,axp152", .data = AXP152_ID }, + { .compatible = "x-powers,axp202", .data = AXP202_ID }, + { .compatible = "x-powers,axp209", .data = AXP209_ID }, + { .compatible = "x-powers,axp221", .data = AXP221_ID }, + { .compatible = "x-powers,axp223", .data = AXP223_ID }, + { .compatible = "x-powers,axp803", .data = AXP803_ID }, + { .compatible = "x-powers,axp806", .data = AXP806_ID }, + { .compatible = "x-powers,axp809", .data = AXP809_ID }, + { .compatible = "x-powers,axp813", .data = AXP813_ID }, { } }; diff --git a/include/axp_pmic.h b/include/axp_pmic.h index 01ebba63479..4ac64865831 100644 --- a/include/axp_pmic.h +++ b/include/axp_pmic.h @@ -26,6 +26,18 @@ #define AXP_PMIC_SEC_DEVICE_ADDR 0x745 #define AXP_PMIC_SEC_RUNTIME_ADDR 0x3a +enum { + AXP152_ID, + AXP202_ID, + AXP209_ID, + AXP221_ID, + AXP223_ID, + AXP803_ID, + AXP806_ID, + AXP809_ID, + AXP813_ID, +}; + int axp_set_dcdc1(unsigned int mvolt); int axp_set_dcdc2(unsigned int mvolt); int axp_set_dcdc3(unsigned int mvolt); -- 2.37.4