Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp923458rwl; Wed, 29 Mar 2023 10:07:02 -0700 (PDT) X-Google-Smtp-Source: AKy350Y8iwUVxKHzCuy21HqcDFXaaAOwYmt4uS4nqPaClZVGdDepuCPGjLpkGuGIgh8EYmhskY3R X-Received: by 2002:a17:907:c710:b0:8b1:806b:7dbb with SMTP id ty16-20020a170907c71000b008b1806b7dbbmr22749839ejc.51.1680109621976; Wed, 29 Mar 2023 10:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680109621; cv=none; d=google.com; s=arc-20160816; b=kgJB7iSHTAxIOlY8NCpRei+NBOlJFhVd8nw72OmdrVjBr2du2Gnr6AhzrynGmLdens RzUIO3h8dYoFst39vENhTD9g3c3H07snn6zP3UMh2bucOr9sqGd/7BSzVkIkNIeDsSX+ jFWfcLgZk0jQdC/qp8Ur0ElmvzNuaxBkLUQRRkFO9E88RfIaASJZL//WzESfJtxxnZwE AWvZm50sPpB84rM9oZFwVxABX61IxKh7WIFATdV95Q5uJ7YGhsP/fTdkLPMPZTP8Twn7 +ynrNNGFNpkUHhDbo5jX3dVmbHcpW9O7KhazQ3zb8tZsILT5HDi3aW+3ePJ7gMtRVNH6 UXPQ== 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 :dkim-signature; bh=O5DsAc5WTnmacv/7THChhT8JqsJtttMhYOjRGHDWcNE=; b=F8ZZQlPmV+sOFUdiyQ1di5UPP4Pnd809HqH8cnn7iZUtb21X9eclDXY2KR/XZn4s1y Qrs4QzzFn1iij5ciksk/w4BmHt4BqikiP6ok9PxGE/RqcIju1budjNLnQFG3o8sLT8uT XCV/InSRjmAKBP6ZY9jKy6UvUVUxAeTj9FUVgR1bMIUSsUGpUNwgzGAA0kl2WQOtQv/B R5nhRhT5Z+qX7TRWlcztqMkj11i7veneBEgcXasj3y0j4VTK+LCtaCWprFcAQbwB2Zhm 4w/BZXZKJhOj1mdEyUzbt8FDv5l0AZWUPAXUqZoOlwixSBnGgIWhyTlvWnj3SOQnLYJn gMgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=E3itYqlM; 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=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020aa7db8f000000b00501c1f1a0fesi19784473edt.590.2023.03.29.10.06.37; Wed, 29 Mar 2023 10:07:01 -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=@z3ntu.xyz header.s=z3ntu header.b=E3itYqlM; 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=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbjC2Qzx (ORCPT + 99 others); Wed, 29 Mar 2023 12:55:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbjC2Qzh (ORCPT ); Wed, 29 Mar 2023 12:55:37 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 065C84EC1; Wed, 29 Mar 2023 09:55:26 -0700 (PDT) Received: from g550jk.localnet (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 15923C70B4; Wed, 29 Mar 2023 16:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1680108895; bh=YO3NMfmF8k8c2SMDbtovBtifO5Xf9pUHpYiPdojn0RE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E3itYqlMkUsCTXNp/xPm73NIKtrRkqc9OUpdY6rWG0LQ6qw1TQm5QQMrI2Zw56uHp Su7YzBHDZfEGyfVTnIX3qFIQ5dlidopybq4MJlcU11OugLXcL18azperBZn/amF2k0 PRlL+Az4+Kw3BcLBtf1JTuEoGsQpLhF3rGsDoKbw= From: Luca Weiss To: Pavel Machek , ~postmarketos/upstreaming@lists.sr.ht Cc: "Lin, Meng-Bo" , linux-kernel@vger.kernel.org, Lee Jones , Rob Herring , Krzysztof Kozlowski , Nikita Travkin , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: Re: [PATCH v2 2/2] leds: aw2013: Add vddio regulator Date: Wed, 29 Mar 2023 18:54:54 +0200 Message-ID: <2672233.mvXUDI8C0e@z3ntu.xyz> In-Reply-To: References: <20230320174949.174600-1-linmengbo0689@protonmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Freitag, 24. M=E4rz 2023 09:32:52 CEST Stephan Gerhold wrote: > Hi Pavel, >=20 > On Thu, Mar 23, 2023 at 08:35:02PM +0100, Pavel Machek wrote: > > > Some LEDs controllers are used with external pull-up for the interrupt > > > line and the I2C lines, so we might need to enable a regulator to bri= ng > > > the lines into usable state. Otherwise, this might cause spurious > > > interrupts and reading from I2C will fail. > > >=20 > > > Implement support for "vddio-supply" that is enabled by the aw2013 > > > driver > > > so that the regulator gets enabled when needed. > > >=20 > > > Signed-off-by: Lin, Meng-Bo > > >=20 > > > @@ -348,16 +350,20 @@ static int aw2013_probe(struct i2c_client *clie= nt) > > >=20 > > > goto error; > > > =09 > > > } > > >=20 > > > - chip->vcc_regulator =3D devm_regulator_get(&client->dev, "vcc"); > > > - ret =3D PTR_ERR_OR_ZERO(chip->vcc_regulator); > > > - if (ret) { > > > + chip->regulators[0].supply =3D "vcc"; > > > + chip->regulators[1].supply =3D "vddio"; > > > + ret =3D devm_regulator_bulk_get(&client->dev, > > > + ARRAY_SIZE(chip->regulators), > > > + chip->regulators); > > > + if (ret < 0) { > > >=20 > > > if (ret !=3D -EPROBE_DEFER) > > > =09 > > > dev_err(&client->dev, > > > =09 > > > "Failed to request regulator: %d\n",=20 ret); > > > =09 > > > goto error; > >=20 > > Won't this cause failures when optional vddio is unavailable? >=20 > The regulator core should print a warning "supply vddio not found, using > dummy regulator" but then proceed normally. >=20 > I think in almost all cases a separate I/O supply should actually exist > that could be described in the device tree. It was likely just omitted > because it's always-on or indirectly being enabled by other devices. > So perhaps having this warning is even a good thing? Just briefly jumping in, there was some activity adding bus_regulator to th= e=20 i2c-core a while back, maybe that can be revived instead? For CCI (camera i= 2c)=20 we also need pull-ups and I don't think adding vddio or whatever to all=20 sensors is a good idea long term... https://lore.kernel.org/lkml/20210527075556.1709140-1-hsinyi@chromium.org/ Regards Luca >=20 > Thanks, > Stephan