From patchwork Wed Jan 5 15:15:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 12704488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B6E0C433F5 for ; Wed, 5 Jan 2022 15:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236858AbiAEPQN (ORCPT ); Wed, 5 Jan 2022 10:16:13 -0500 Received: from aposti.net ([89.234.176.197]:42226 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237011AbiAEPQI (ORCPT ); Wed, 5 Jan 2022 10:16:08 -0500 From: Paul Cercueil To: Jean Delvare , Guenter Roeck , Jonathan Corbet Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, list@opendingux.net, Paul Cercueil Subject: [PATCH v2 0/2] hwmon: Add "label" attribute v2 Date: Wed, 5 Jan 2022 15:15:49 +0000 Message-Id: <20220105151551.20285-1-paul@crapouillou.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Hi Jean, Guenter, A V2 of my patchset which allows specifying a hwmon device's label from Device Tree. When the "label" device property is present, its value is exported to the userspace via the "label" sysfs attribute. This is useful for userspace to be able to identify an individual device when multiple individual chips are present in the system. Note that this mechanism already exists in IIO. Patch [1/2] documents the ABI change. Patch [2/2] adds the change to the core drivers/hwmon/hwmon.c file. Changes from v1: - The label is cached into the hwmon_device structure - hwmon_dev_name_is_visible() renamed to hwmon_dev_attr_is_visible() - Add missing include - The DT binding documentation of the "label" property has been dropped, and the "label" property is now supported directly in dtschema. Cheers, -Paul Paul Cercueil (2): ABI: hwmon: Document "label" sysfs attribute hwmon: Add "label" attribute Documentation/ABI/testing/sysfs-class-hwmon | 8 +++++ Documentation/hwmon/sysfs-interface.rst | 4 +++ drivers/hwmon/hwmon.c | 34 +++++++++++++++++++-- 3 files changed, 43 insertions(+), 3 deletions(-)