Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4375231pxb; Wed, 20 Apr 2022 01:39:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSCURQJBC6nPuGkWBSdbZzwof9+LcUU6ez5y7IaB94BiOkdjbrxwjOZaTHCxBzUhn5fcqd X-Received: by 2002:a17:907:9958:b0:6e7:f67a:a1e7 with SMTP id kl24-20020a170907995800b006e7f67aa1e7mr16483546ejc.400.1650443997932; Wed, 20 Apr 2022 01:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650443997; cv=none; d=google.com; s=arc-20160816; b=BjadTt4rJJPsfu+W4SrV9vsMcGrQT2WlUoRBFngIjLKc8qTWxlQaQhuIF5jQSz0wLx dbesh9RhlPyBUUcdfPldNe8rgE1sXP5Kec6RkFT2q521EGjZpvuyeorub42GD9iXgr24 aKIgtxIhZB3FY9ouJlqXs7hax1JGKiSnUW9gONTdoxqxLhBmq6A4XN1nJb6pYgVMHpLR Y1ty2roxwmM/fVhAJeZqGdu3h8g67pVj2liFU0eO+QMQ2nl8eyEB7HPx7d//cC+zV1l2 n7uCGarRBUJ13tfbBrK6US22Dt7IF6GGqCh1n5A4dUh9kGVkrKjR2LSzJ3fzbvY4vXyp TDqA== 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 :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=CZngQfBsYzzOAk/YAglyQ7Wm95FYN4tsduDoER6urxw=; b=HHmy6VLe+fMJ6Y1Fy1Mrea+0JmOx3u2ac+mkY/uFbL3DxvvQm4n7B19GI5KHeAEfsz MmIolqCqxfC9mvruCTXfDl2oXmXKQcQYloUQ4KEGfTqeZiTZu69n3kZ073TGwjn4LYEb xn0KymUFcnQ7MongWjFUXpscYOGqY5ojcnFo9tOF0B6Pp+vCR1DNxmnbAp+HF5tAfYid 7ctkCLqE6k7r+r4wDHDmtLiLumb6K+rJ3MzNSukImkqu7P4Jqw+hHk7l/wca5BWJh45R AA2ms5L5uKdzGahAofRzSryXE/uOfTopohT7EoUQV1tZS+XJdJYu5eh00xkMR9+9Efcy IyhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wujek.eu header.s=protonmail2 header.b=LUWyrXpD; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020aa7c54d000000b004237b23b6f4si847037edr.282.2022.04.20.01.39.32; Wed, 20 Apr 2022 01:39:57 -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=@wujek.eu header.s=protonmail2 header.b=LUWyrXpD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344023AbiDSWVU (ORCPT + 99 others); Tue, 19 Apr 2022 18:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239117AbiDSWVS (ORCPT ); Tue, 19 Apr 2022 18:21:18 -0400 Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2850222512 for ; Tue, 19 Apr 2022 15:18:35 -0700 (PDT) Date: Tue, 19 Apr 2022 22:18:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wujek.eu; s=protonmail2; t=1650406713; bh=CZngQfBsYzzOAk/YAglyQ7Wm95FYN4tsduDoER6urxw=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=LUWyrXpDJIy+CPmfGYSAyvokVH2LbtzDfqxqOOKLRdLXtqBRsSbTQhWvczgAcpeT+ pO9sJ4rcsrtcrs0X/aqCCiN1cjStAIKUKFX2KHhxu0wkellqLuuywhDvduxX4Xad+z 3a2uwmizWpi7Mzn25mEKvQAe2vge43tm1rw+EMpb+E6WtkpYJR7mC+lIMh2aQ/1KGz R7RIfuZY8F7FP03RUBtNJQls916c9AUODnTsPeUfbdpaYth6qIIBeKRrp1FqDX10iR XWUlORfN2hWzrVe9PkHzaeCToQWUFshSo6KCWykO1hJRd4lb2j+Ys5sZrQQWl41IOD twXt6A6Ior5hg== To: Guenter Roeck From: wujek dev Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: wujek dev Subject: Re: [PATCH] hwmon: (pmbus) allow to use a custom read_byte_data function for PMBUS_CAPABILITY Message-ID: In-Reply-To: <23a10930-e78b-d795-056e-879e52e2b45f@roeck-us.net> References: <20220419215149.309760-1-dev_public@wujek.eu> <23a10930-e78b-d795-056e-879e52e2b45f@roeck-us.net> Feedback-ID: 23425257:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,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 ------- Original Message ------- On Wednesday, April 20th, 2022 at 00:08, Guenter Roeck = wrote: > > > On 4/19/22 14:52, Adam Wujek wrote: > > > Some devices returns a wrong value in PMBUS_CAPABILITY register. > > Allow the use of read_byte_data function defined in a driver for > > a specific device. > > > Those devices should set PMBUS_NO_CAPABILITY. > > Guenter Yes, you're correct. I was working with the older kernel. Please ignore thi= s patch. Adam > > > Signed-off-by: Adam Wujek dev_public@wujek.eu > > --- > > drivers/hwmon/pmbus/pmbus_core.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmb= us_core.c > > index f8ca36759b0a..ef9989be8f89 100644 > > --- a/drivers/hwmon/pmbus/pmbus_core.c > > +++ b/drivers/hwmon/pmbus/pmbus_core.c > > @@ -2011,7 +2011,7 @@ static int pmbus_init_common(struct i2c_client *c= lient, struct pmbus_data *data, > > } > > > > /* Enable PEC if the controller supports it */ > > - ret =3D i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); > > + ret =3D _pmbus_read_byte_data(client, -1, PMBUS_CAPABILITY); > > if (ret >=3D 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) > > client->flags |=3D I2C_CLIENT_PEC; > > else > > -- > > 2.17.1