From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A78B8C433EF for ; Tue, 26 Jul 2022 10:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4K4lz6K+GezkIbUdXXeQz9C5vc08s9RbzPpQskYbQKo=; b=r2dkpMM0IF+8O2 AzII2o2swlnbKWA0OHJiEqKI5phhVEa7oWs4BQRGG040HR1o+6WPN79GqNJjUImv9D9KB0jGcwhYd dGAnSG0WOyhn1WCj+dI+S04K5cbGTbLQ7aEJpiPpxwVMQPpYe+68+uQJjM4ri385owNR1h2Gw+hFL liVnmHk93V35GyVec6jSG+Cryq+SoIiRs+jX1KOfaMtUJ54CCxzj3iD1tp1QBGNBAPIiEc0MkrI6o dmZgitIZMM/YcMP67ZjX7++gI/2Z6IuT/xSS0Tq8LdYIH6Fjt8NUvSQkS121hsdhQcv33r/B7JRXO IC2se794MrEAYoXgrNGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGHvy-00Dxxn-63; Tue, 26 Jul 2022 10:37:02 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGHtT-00DmhA-Bt for linux-arm-kernel@lists.infradead.org; Tue, 26 Jul 2022 10:34:28 +0000 Received: by mail-wr1-x433.google.com with SMTP id bn9so8657929wrb.9 for ; Tue, 26 Jul 2022 03:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hS5D+tKbOtBBnrOkxwJ+MyP4haeEuYAKYGV01jemHh0=; b=tazKIxvSUmt6J8AlUGlpWsUbd1SkCcezN+LsSgrroc8Y6wJDPNvv93O2bwymIQSTBz s91p1uCClrS8RHDFvkBAPn9NKtl7r3P1/hitEiY4eMnl59fpTyVvn7uSW5ttsEsVRuo9 EgLuocfIZ5LGYgy1N//Y21EweNr7UM4yNe22Tq+zG6qTGULrA2QOpyM7C6U0ZHZEfNTR jaBRaSBY+m7t0gu1ZSyD52oJEvuVCkXj66EGaqnLROMGwZIsCEYvNFgd2DvwZSad8mhx SoloGOhX+r5BO1zfnYDLtO1AdAOfvKXRgSrWy5rajVT29NQCy8sZubLQmyEyfgUZQspx eGfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hS5D+tKbOtBBnrOkxwJ+MyP4haeEuYAKYGV01jemHh0=; b=UJEZuhvt7Bz83sSoaGD7j5qyr/GUGvF2G3kyvEhHkykIXkYk7/d7qHNcKzDav2pEPg /GrqR0i6GpeNjPO2tSTofhUm6FuQnPvHSRMr0MVeYjp94p4jipvRfnWs0VnSqJiOwsH7 zGH2R7AeNAnSfnqfNVJSQDIOqswcemqAf06u4d5tw5hZf3YRUHS0vHfOq4zq8HDiO9rG DUFjIB3SS9ErfzYI+oYDh7P3hw4++v6PSXv8zOUN16jTqVpCFG3pNv1OUSZy4n/6FHyW fn4GTH2QjZ3UOSGQ+QcPg12XKrjRC0QsD/WxyakYgOzXjcWJJh2HPQJgsg97cAkN6Zz0 mWxQ== X-Gm-Message-State: AJIora8AjV/5uE8ctkn846jc/K29mTO2uc8SMSWFPGT+IrBxL8ScJxHp DGlDdUj8d/88fPUr1phXFj2Oqg== X-Google-Smtp-Source: AGRyM1tq7HlxOzT1Cq9RfdORMGki4QGIyKxdZNlYeX0V4zEmHct8A4MmWKu17E7X6Vdx1RF/3wgeEQ== X-Received: by 2002:a5d:59a6:0:b0:21d:bc0b:d762 with SMTP id p6-20020a5d59a6000000b0021dbc0bd762mr10396083wrr.637.1658831666001; Tue, 26 Jul 2022 03:34:26 -0700 (PDT) Received: from localhost.localdomain (2a02-8440-4641-6f91-91b7-326a-5d27-a1c3.rev.sfr.net. [2a02:8440:4641:6f91:91b7:326a:5d27:a1c3]) by smtp.gmail.com with ESMTPSA id ay35-20020a05600c1e2300b003a2e42ae9a4sm20617121wmb.14.2022.07.26.03.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 03:34:25 -0700 (PDT) From: Jerome Neanne To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, nm@ti.com, kristo@kernel.org Cc: khilman@baylibre.com, narmstrong@baylibre.com, msp@baylibre.com, j-keerthy@ti.com, lee.jones@linaro.org, jneanne@baylibre.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 08/11] mfd: tps65219: Add power-button support Date: Tue, 26 Jul 2022 12:33:52 +0200 Message-Id: <20220726103355.17684-9-jneanne@baylibre.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220726103355.17684-1-jneanne@baylibre.com> References: <20220726103355.17684-1-jneanne@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220726_033427_446307_23C58CCD X-CRM114-Status: GOOD ( 14.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Markus Schneider-Pargmann Using a power-button on the EN/PB/VSENSE pin of TPS65219 is optional, so this driver adds the mfd cell for tps65219-pwrbutton only if needed. Two interrupts are passed to the driver. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Jerome Neanne --- drivers/mfd/tps65219.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c index 7366f251c21d..e1c30a49bf08 100644 --- a/drivers/mfd/tps65219.c +++ b/drivers/mfd/tps65219.c @@ -335,7 +335,10 @@ static int tps65219_probe(struct i2c_client *client, struct tps65219 *tps; int ret; unsigned int chipid; + bool pwr_button; bool sys_pwr; + struct mfd_cell cells[TPS65219_MAX_CELLS]; + int nr_cells = 0; tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); if (!tps) @@ -364,9 +367,16 @@ static int tps65219_probe(struct i2c_client *client, return ret; } - ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65219_cells, - ARRAY_SIZE(tps65219_cells), NULL, 0, - NULL); + memcpy(&cells[nr_cells++], &tps65219_regulator_cell, + sizeof(tps65219_regulator_cell)); + pwr_button = of_property_read_bool(tps->dev->of_node, "power-button"); + if (pwr_button) + memcpy(&cells[nr_cells++], &tps65219_pwrbutton_cell, + sizeof(tps65219_pwrbutton_cell)); + + ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, cells, + nr_cells, NULL, 0, + regmap_irq_get_domain(tps->irq_data)); if (ret) { dev_err(tps->dev, "mfd_add_devices failed: %d\n", ret); return ret; -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel