Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4245203pxv; Tue, 27 Jul 2021 02:28:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIeJDpc8EOP2X8zVm/JCS2S9/RUXNfnnqAGPpRRFBBptQaKI/KYAsNuFZ2eV/u2b7qU4JX X-Received: by 2002:a17:906:3b47:: with SMTP id h7mr13964669ejf.399.1627378087730; Tue, 27 Jul 2021 02:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627378087; cv=none; d=google.com; s=arc-20160816; b=dtLoaRaKFjCNskKKfDO4HZ6GbeEmdGRF4SopXKm+Ng1DiX1ZoVUnGiZwwlvd5G9J4d k3W1oe8TUXbUvXnXkDE8r6dlbWFTcDnGobzs4XfLPywsmgj+plJwfgEPfMPsIGuhLpbN s5UcuWllu9sEZB2FJ8cj4RtV/mJBbzfyGkkg74+d00519rbGKlmP5VUnbbXH8V1cvR20 Bk3KCSJbcx9eerPeAT9K+ffcUrH7Yaf/HFKU5JEUZYLdfv+eD6UIxerNCPPXT3b5biMq c51n1MCFgX5au+u5BQlreJI3orOuSP7j3iKGg/ouCAJlV721vvCU1rO37YiffhEKKbT/ BBeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=mBKXCsHfwip4Rwb+DfNH2Tu2tuIAQDn6p9m9ppniW64=; b=B/TASYl8a6cgJceI1P/yeO46bcLE+irFNifAryFFVtVCxKOR1p94GBqT4a7kiDk5AG PSLTIlnU1BpiQajjVzjMgbV6sxrbaxjzBFa3cnw+qabH3OIpBJHaFcCF2QbfDUjBLRz7 5pfsqeDSbpWfdLAwUbzeA5BedXHYNNkwXFVXMs0CetjRsUDJuYSoti7cXo3Afdb/lPfM voRCV6/0uPty/a5oQJJtJGm9JN5LoS0D6E/x4J5fHVLEW+MEE8HktLqFFS1SkVfh6Jg3 gYKVE7KohPpTKLZQCOEtLf0NLz0yMLx0EOCsM28NlTGWFf9SRDWbnAol977LguDzLGoK pLaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PaYQREom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si2275462edq.592.2021.07.27.02.27.44; Tue, 27 Jul 2021 02:28:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PaYQREom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236098AbhG0J0M (ORCPT + 99 others); Tue, 27 Jul 2021 05:26:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236065AbhG0J0J (ORCPT ); Tue, 27 Jul 2021 05:26:09 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC94AC061764; Tue, 27 Jul 2021 02:26:08 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id gs8so7527120ejc.13; Tue, 27 Jul 2021 02:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mBKXCsHfwip4Rwb+DfNH2Tu2tuIAQDn6p9m9ppniW64=; b=PaYQREomEDTfoBTOeayOvSQUZPuLugWj1zJJ3wgIho7cyBxghUd8rdo9sVvOBnyA70 p5VOpxCCd2KFsoeDfFqFcAV1oz9W7gJSI3LAg2WHBWR3p9B++pUpKeB6cmHfjroTiBCe GVe/xMCT4Gfjlt7Sv1LqKIkhRtAY++SiJfVm8yV+eETgm4harn/An0dZOrEEmFgrmC2Q gcLTmUGA745v9kb2rRpi+QL3EpUvw1HLw+haR7lDitUBfXJc7k9BKuy5XRSk71D7DC+H T4sbKSUCvCtKV56MpI0rPopwky3D725DWFncVDAgwpFD38pJDZR+CnNCVrJDpqn2yO1Z uGFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mBKXCsHfwip4Rwb+DfNH2Tu2tuIAQDn6p9m9ppniW64=; b=Il4pj0tsWsv+hvtmCUEBTLzmLljJVqpa6S7vt27YeI2bNUejbnovLyf9tlBPjTGjUU 22nkEe7YZQwNYwu1NkIUDCY65MOIfRbww37c+bAzj8N8tg3Um8tnKVZKAL34uIgHxFcL kkqFkNa1m2qMZNmaioS2VR+vgTvhQH8npZ+RV23gAqZ0jK1+iOLoHJ5SKWWpyU28e4y5 iuE4TjbFhQ7JwSNcGLr+NzS7Ihs1FpOQzihmDeWMd8j79l0Z9JpfF2GHRJdidAs5Rww2 fn5G8AilfXfgIwWagnSpECXeIT0BysEx53wY9pMOvm90rqjU5jlujaqEKXY/DqONJOy9 f+qw== X-Gm-Message-State: AOAM532fy15CZYJU3e8658IpP2DS7fFHaSZD5OcPAz4dkvvINcpMs6t3 O3oGg4QJyAItv1vKfvlxkYw= X-Received: by 2002:a17:906:dbd9:: with SMTP id yc25mr21126510ejb.367.1627377967400; Tue, 27 Jul 2021 02:26:07 -0700 (PDT) Received: from stitch.. ([82.192.166.82]) by smtp.gmail.com with ESMTPSA id g3sm692369ejp.2.2021.07.27.02.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 02:26:07 -0700 (PDT) Sender: Emil Renner Berthing From: Emil Renner Berthing To: Lee Jones , Rob Herring , Sebastian Reichel Cc: Emil Renner Berthing , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring Subject: [PATCH v2 2/4] mfd: tps65086: Make interrupt line optional Date: Tue, 27 Jul 2021 11:25:52 +0200 Message-Id: <20210727092554.1059305-3-kernel@esmil.dk> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727092554.1059305-1-kernel@esmil.dk> References: <20210727092554.1059305-1-kernel@esmil.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The BeagleV Starlight v0.9 board[1] doesn't have the IRQB line routed to the SoC, but it is still useful to be able to reach the PMIC over I2C for the other functionality it provides such as GPIOs and regulator settings. [1] https://github.com/beagleboard/beaglev-starlight Signed-off-by: Emil Renner Berthing Acked-by: Rob Herring Acked-for-MFD-by: Lee Jones --- .../devicetree/bindings/mfd/ti,tps65086.yaml | 3 --- drivers/mfd/tps65086.c | 21 ++++++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml b/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml index 9f6e1349eadc..6aeedda3be15 100644 --- a/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml +++ b/Documentation/devicetree/bindings/mfd/ti,tps65086.yaml @@ -87,9 +87,6 @@ additionalProperties: false required: - compatible - reg - - interrupts - - interrupt-controller - - '#interrupt-cells' - gpio-controller - '#gpio-cells' - regulators diff --git a/drivers/mfd/tps65086.c b/drivers/mfd/tps65086.c index 341466ef20cc..cc3478ee9a64 100644 --- a/drivers/mfd/tps65086.c +++ b/drivers/mfd/tps65086.c @@ -100,29 +100,30 @@ static int tps65086_probe(struct i2c_client *client, (char)((version & TPS65086_DEVICEID_OTP_MASK) >> 4) + 'A', (version & TPS65086_DEVICEID_REV_MASK) >> 6); - ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0, - &tps65086_irq_chip, &tps->irq_data); - if (ret) { - dev_err(tps->dev, "Failed to register IRQ chip\n"); - return ret; + if (tps->irq > 0) { + ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0, + &tps65086_irq_chip, &tps->irq_data); + if (ret) { + dev_err(tps->dev, "Failed to register IRQ chip\n"); + return ret; + } } ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65086_cells, ARRAY_SIZE(tps65086_cells), NULL, 0, regmap_irq_get_domain(tps->irq_data)); - if (ret) { + if (ret && tps->irq > 0) regmap_del_irq_chip(tps->irq, tps->irq_data); - return ret; - } - return 0; + return ret; } static int tps65086_remove(struct i2c_client *client) { struct tps65086 *tps = i2c_get_clientdata(client); - regmap_del_irq_chip(tps->irq, tps->irq_data); + if (tps->irq > 0) + regmap_del_irq_chip(tps->irq, tps->irq_data); return 0; } -- 2.32.0