Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29617754rwd; Wed, 5 Jul 2023 14:53:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlGT6pLrS6h1Fi1cQbWj5RB0wYBU03iHMU5V/VLPVPC5ewoCjvCTVnlN06oZXfTzNIM2UnZb X-Received: by 2002:a17:90a:cb97:b0:261:2824:6b8c with SMTP id a23-20020a17090acb9700b0026128246b8cmr4927314pju.13.1688594010237; Wed, 05 Jul 2023 14:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688594010; cv=none; d=google.com; s=arc-20160816; b=KErxHuVuAOYIWoZlkFAN4GNqODljRRemFE/hsluyN3WeJOeowt1cbSxXLqMqDELy04 e0taeOSk1FtiT76iYdnUIxI1R3sQOfkEMNE17vEX8buFgg6oBW+QIG++ZEr4TALdhEAp yx6bbz7lb8zgxjPaIT/oHhdYnhD0ZYzTBp/wReq/eyeduVPbQrOweQ5HoB0TXkwmCLaz OmfXJPs/qIQ4QwDKzV7hWCUqej1ojlp+g7QtcJ/BTZkB6xWyniWWnjhLtQN6MTNZ5QKD AL+mrNvl4FqhYuopb8PqhMcovri4qHi4ePBA+gWkRl48YGg3cZB+IvTaUltkw3z/gY0Y v2YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JlA7Omc66rXMNTH6X1ydcJJyDlSBvcJI/ger0lg7xWk=; fh=7R/PBPmKxJSdsBa+DCojfZPTaw6d/K08VEWZak/jnT4=; b=wzsmSiU4NM9+mU+OKH72TT90pu+f/Hh4ws6WGlGeaiImZJue0XmVWwNZGx6Z4W2SkG qXyMC58RKbGgkmI9kXk9wZCbuZGItVzbx8JetvteZ5BHXM0SmalacMUe2C91vVryZVZN vQfRypp2uhPHMHhLNIhfg+s2d/LaAHUg52ySk6KRS/8NRYjU93VLhKEkyDPQqBHqgDUI /CNwEL/NyZbafxUmvg0W2XvjNnkEiU2CSRWVeL9OzuWWGPKwjTbFH0LOetsVUMnYQeyI gRNrUSSWOnWblumvNOY7pEaju+J01RdH9zIwlKX6t4qyWBjo/5ggxPp02lfTtdv+UOA3 N0FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="l/5lrwFm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d22-20020a17090a111600b0025690f8610bsi2366089pja.59.2023.07.05.14.52.44; Wed, 05 Jul 2023 14:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="l/5lrwFm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbjGEVuI (ORCPT + 99 others); Wed, 5 Jul 2023 17:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233022AbjGEVt2 (ORCPT ); Wed, 5 Jul 2023 17:49:28 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 891081BD0; Wed, 5 Jul 2023 14:49:25 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b852785a65so151485ad.0; Wed, 05 Jul 2023 14:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688593765; x=1691185765; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JlA7Omc66rXMNTH6X1ydcJJyDlSBvcJI/ger0lg7xWk=; b=l/5lrwFm5S27bh4okIpLe8W9g6TnfrmD1hDoFUP4abPVME+Ose3bNs1mtZu//oMoGx Us1VUD1Oa4+QAEDOl/FzgagEbhT4xkFJw/WOg/tmKtVUYovVKA9LtaVgLJVzXIsjID/X iI8+jQ35Sm+dLdbO2EtVjfuOpwJS9RHZesZJdXb2CgQ0/JDJjV0KYCXxHGw4+CttLq8A fOqoD+c0bT1fwV75DK6LuTwwXgFhHol8ONfy7Ai+SaxID89n58Sd118zXK7UjVXarm83 vrzARZoooAdW2+SopGdlqtAfDX/VCdOManSfphUqpxakZi2Mi+o67/VpDvwGxOKLAUQI PLBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688593765; x=1691185765; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JlA7Omc66rXMNTH6X1ydcJJyDlSBvcJI/ger0lg7xWk=; b=gB7uV8kGnnLNbO3IkergJRPCTsZWKuftcUmA12UfvzGt6Mmr/gaCbQBffN37tXgDGK OPAqwh0EDWRDtaGS7WbsJu5glRX5FRBQWXHGs2IG5ZvHGEdxKAvgjiZ+JlxXUmUhgMPu 45WgH9E9qM5jGzEB44fAUNaK+6ja1K9UXXQydSDmqDy7SxkNs3eh0mySG7jH2fqMxyBK dh5CtgWqnfBT3N3U/4UXYZf09xtzIa3tj0iRKeWbnnyWCwZ1OqNjSGDDBZ796e/Y7dUQ kaEXmEmSocxItiIqYKXckDHuUj9iePJgkvFgAN6hs886HQvnTa/+aJaTHfnYEnwgytmF QCxw== X-Gm-Message-State: ABy/qLZOAOApkFuhvgQF12UBxEVetRzwPUVDqSnl6tF4krwU49pG+5A2 j4n99UJtgfTifdNZLxArTRQ= X-Received: by 2002:a17:902:e78a:b0:1b8:7613:594d with SMTP id cp10-20020a170902e78a00b001b87613594dmr4383059plb.24.1688593764637; Wed, 05 Jul 2023 14:49:24 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:9fac:a99f:7f0a:397]) by smtp.gmail.com with ESMTPSA id bh1-20020a170902a98100b001b3f039f8a8sm13129482plb.61.2023.07.05.14.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 14:49:24 -0700 (PDT) Date: Wed, 5 Jul 2023 14:49:21 -0700 From: Dmitry Torokhov To: Mike Looijmans Cc: devicetree@vger.kernel.org, linux-input@vger.kernel.org, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] Input: exc3000 - Support power supply regulators Message-ID: References: <20230703084536.8429-1-mike.looijmans@topic.nl> <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.12499438-d166-465a-8847-b25e1baa3dad@emailsignatures365.codetwo.com> <20230703084536.8429-2-mike.looijmans@topic.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230703084536.8429-2-mike.looijmans@topic.nl> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FSL_HELO_FAKE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mike, On Mon, Jul 03, 2023 at 10:45:36AM +0200, Mike Looijmans wrote: > Add power supply regulator support to the exc3000 devices. > > Signed-off-by: Mike Looijmans > > --- > > drivers/input/touchscreen/exc3000.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c > index 4af4c1e5d0da..3e50af8a4a2d 100644 > --- a/drivers/input/touchscreen/exc3000.c > +++ b/drivers/input/touchscreen/exc3000.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -360,6 +361,12 @@ static int exc3000_probe(struct i2c_client *client) > if (IS_ERR(data->reset)) > return PTR_ERR(data->reset); > > + /* For proper reset sequence, enable power while reset asserted */ > + error = devm_regulator_get_enable_optional(&client->dev, "vdd"); > + if (error && error != -ENODEV) > + dev_err_probe(&client->dev, error, > + "failed to request vdd regulator\n"); If there is a regulator described in the firmware we should not continue with initializing the device if we fail to grab/enable it. Think about what happens if you get -EPROBE_DEFER here. You should return here. Also, why are you using the _optional() variant? VDD is not an optional for the controller. regulator_get_optional() is needed when you need to alter the behavior of the device/driver depending on the presence of an optional supply, whereas here it should work fine with a sub supply that will be created if you simply call devm_regulator_get_enable() and there is not regulator mentioned in DT/ACPI for the board. Thanks. -- Dmitry