Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp861369pxb; Fri, 22 Apr 2022 12:52:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGmRlKDkyHmmDaBudIPyvwCUy7C//K/fWN6MDne/9VL1WgqJ3+3k0EjA9t7cEFs2QkorUA X-Received: by 2002:a05:6a00:ad0:b0:4f7:a357:6899 with SMTP id c16-20020a056a000ad000b004f7a3576899mr6520211pfl.80.1650657168045; Fri, 22 Apr 2022 12:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650657168; cv=none; d=google.com; s=arc-20160816; b=JvXosk3jd2Qv4k8AvGOrAZD1FxwrbjRMy8KQOG4FXXeSWWW3N7z74hZo2HapArIuUb fjp9LFBUHqgItepD6IQcQ21t/JZstXx/T3ZLg/yNE2wO5H31lDzUpyv/SUcePxTBnJ1J f6xeFedY0QjBaqXe/og7zUSL3E74dIslKqH7L8Y+NPy3cT02LAXPfzIQguPN4Y710p3A RKtmNtsZzahV6QW3xQXlbiRDU10LxidzfSYKRMkaXfd0QYsKWCZAY8w3FbY15eeDPpo1 IoFe9sIvT9cM2Mn8z7RMeWDKw7fE6KV785q1/vwQQckzELE+yEKVvBnAAX0YY2qdm84p uW2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=UengR8EXwoi99sl+0v/VkxO2Wro5UnJAJe1MiM+zYBg=; b=wmWKRsg9wWRcFcs05BW75l/+2g+WBmcH3p69KHF+sVimqZRRNIW2xbsSY8HBX2b4m0 Jqdgb63lscjUUYJBWzl3kXP7v4uQaQ+CQG04y6XmDnSUtUS2D6ka8FS7MAgBTu+0NcxX Fa9+Oym+9GntXbECO3++66mK1L/a31f/fpEg9x1e6tDULtzPC/x0wICyuv2ATVdunhFS 3Bx/LroFxRKYaNFiXnYBbQzLaAiBN2lgSq+W3IPwuiAXtrgiZGqrcwu6sphRBPkMsW4d A5vfaPuOHnJZfLR+LmRja+2PoUxB7kZl887Zpyz+QEsbDwqDDVBAVERpCBz7rQk/vuGE 0N4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EyxeeAL5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p13-20020a63f44d000000b003aa3662bf20si8589159pgk.879.2022.04.22.12.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EyxeeAL5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46FE92215E9; Fri, 22 Apr 2022 11:54:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357736AbiDSWLH (ORCPT + 99 others); Tue, 19 Apr 2022 18:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240049AbiDSWLF (ORCPT ); Tue, 19 Apr 2022 18:11:05 -0400 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA7DB3B29B; Tue, 19 Apr 2022 15:08:21 -0700 (PDT) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-e5e8523fcbso71070fac.10; Tue, 19 Apr 2022 15:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=UengR8EXwoi99sl+0v/VkxO2Wro5UnJAJe1MiM+zYBg=; b=EyxeeAL5cqxhXMtnwg0zICaKaV3hPzxTOkSrVkmUuamldURGloDGg1fqnmDD/pQV65 cUgy+YO+CvzE60OyZy8YpmA0I/grGUUcCPex6B0La0HnT3/GwtMfcHDyWp63HoXP0jQl jRUDxhCWcqwjJF+zENtRk7vl0t0QuFu7xVAHGPa1YtdMCa2dpxYQpJfHmNak475VZSsZ rVvJ7leskZwAgOh6W0fqwYPRYi2YseQ+cRUjr3dUb96NT1vxtBm9Tit3e3J3Ukj+smCs q9V8SrCtG6Z4zVSqLHVJVhCwVsYtQN4a2/l4p8Jamo8bowMwc9crIdAoTucwDYpCyCws PloQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=UengR8EXwoi99sl+0v/VkxO2Wro5UnJAJe1MiM+zYBg=; b=emQ7xXUXrTf8NUmCPa8zFdKktZPVnkpLOYperPxKj+D9QN+LzmWg+BtnvmYbkcyrZG +30iWfnVJyU6YoLQG+puRmf0is1g692lIxvgPdzX1XrUznmNp/1N77/lOZCZ0u97K4Nc 5Ta7rCrgvDPzsVMWeaggbxGx0O4RkcnjxX/oqby6zAbRrVsZPB6w5b5mXUpqK4OrO2PP gUlfcE2Zm8tiFNe8ga49uxCAkYQonjTTedEKsiidZTyAl6RYXtDpewardPXikJ7+LouE en0fVuAheNfYmFFVoTZqifJaQIqbH08WQftYA/9kbkHzJZypH/8aIPzyeXxzUE/PjdAo 2hcg== X-Gm-Message-State: AOAM532ywg1ONgwgRTtxNq3fmxm98aQM2A/dPPc5rSvFaJ7roPlM4xQZ glA+Y2TjawRP1gptje7DWnmhH2wuQPs= X-Received: by 2002:a05:6870:c142:b0:dd:d5a3:767c with SMTP id g2-20020a056870c14200b000ddd5a3767cmr303112oad.291.1650406101088; Tue, 19 Apr 2022 15:08:21 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n35-20020a05687055a300b000e1e2ab91e4sm5533130oao.39.2022.04.19.15.08.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Apr 2022 15:08:20 -0700 (PDT) Sender: Guenter Roeck Message-ID: <23a10930-e78b-d795-056e-879e52e2b45f@roeck-us.net> Date: Tue, 19 Apr 2022 15:08:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] hwmon: (pmbus) allow to use a custom read_byte_data function for PMBUS_CAPABILITY Content-Language: en-US To: Adam Wujek Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220419215149.309760-1-dev_public@wujek.eu> From: Guenter Roeck In-Reply-To: <20220419215149.309760-1-dev_public@wujek.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE 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 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 > > Signed-off-by: Adam Wujek > --- > 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/pmbus_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 *client, struct pmbus_data *data, > } > > /* Enable PEC if the controller supports it */ > - ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); > + ret = _pmbus_read_byte_data(client, -1, PMBUS_CAPABILITY); > if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) > client->flags |= I2C_CLIENT_PEC; > else > -- > 2.17.1 > >