Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp769605lqp; Wed, 22 May 2024 21:53:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7rD/R12d0Oh/HSahRqJ0O/Ts9RuVXslhuhaqWKb0NUIZhv9ym9/+CExWoIRbyI3BmbRbAtgxXOpk1tuaDL06l9b3TtV7ac+bC/qel/Q== X-Google-Smtp-Source: AGHT+IEcDIS+QQytkIgXoCcskwpZK5sLsya2xhqhAfyhWF5lP8/EFfh1pTSHDEI1OEBE0nyzUFuf X-Received: by 2002:a17:903:2444:b0:1f3:604:4b18 with SMTP id d9443c01a7336-1f31c95c159mr44249815ad.9.1716440010901; Wed, 22 May 2024 21:53:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716440010; cv=pass; d=google.com; s=arc-20160816; b=i63YV/lUXswNwJdISjCcbDPiACUpM9xDbK8n0a5lHZ1xaQTMhXWYrK6FHabKCSqWCF 5Q2XH4lB80XLTX00AdJM6Kx0dlCapiybOs1MQ6nfOz67UtWrQN/9rPVMmHQQSsyDjArE FNJtzKBijoas9VqnIG10ozskkBmMTJWFijXzNZ03nuXBkJCXdJ5KjOCK792H9ewnvBei QUZGli3vFbUEF51PyBmWkjNEV2njzyJrL52z+SGv1xbbszN5E52Y1g1Sqh22u7249gHO RLStu+apRfjQh6uELmrgrg72/oaCuhbwf1MfQylBqodsYo60bHv3Ztwm3T+CUWJfvrcg 7zsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=OvUrI2aaLqa4vMMuqwLUI/YBgeybzl+iDFgIbYUPxuE=; fh=EXlm/fWaaNZRiuPSBbP4vuwjy5KTsIx+H/S5qKiQg3Q=; b=xW6gJlBAyONe9OsGpzDsTc1P/5ZAy5ZVE0srCwUDYeta6xbFQcRFl0C96q1q/h5GOG ovqnAm51JRKlY+nl7xcbrq0g4YrK8c6ysEGXzwNFlYP1OILt5heHozXVH30l3/KJmH3x ZWKRN6pKU4dzhyt0YZr4baedyUb7Z1IW2WA73PMvK6aG12DV4mdDeQdBdudWT04kOmez 6yCHzYyGCA9CAy0kRxHEQG9xPqlFCFpx+PMKqsBKRDzzAdywOn+4nvoq2EHKzwo7iRop XNMwl4yP3QGqrhrlclvz+xOBwylPwE6AiurcCbX3eN/463PEiUjFp6rBAYjlrSt2/UIc WSwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EO0+pQy8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-186986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186986-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f30b38aca7si8580385ad.608.2024.05.22.21.53.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 21:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EO0+pQy8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-186986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186986-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 591842829A7 for ; Thu, 23 May 2024 04:53:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79A8613A86D; Thu, 23 May 2024 04:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EO0+pQy8" Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E39BA33FE; Thu, 23 May 2024 04:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716440002; cv=none; b=beS4HWLYmTHrBO/GEF/Amj1GpgmsDSn7NTvwqsPlvktJcN71vYwaKlnp8+HxpyDgkoDjj1J17c6IVedJ8g7Iavb90UxEBtB0CFSy+5ZUGPiAFKirLaH7mR/NkzJkySVGv/8z8gwHtb/aFox9tMTSqoEeEz2oJh2Btp3KLf89NhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716440002; c=relaxed/simple; bh=1d+eOxxTLTC6cEGMQ0IcUiIluoFQRKoPJoQ6060QEQs=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=WcrYMLdSQx3M8lXVoK+KRt3ldRnhahwPmtiGOeOr0Z0mKmS//AEDQQFxGgAI9h/chHckFOvK3UQZqSY4nrd8B7xXAzUWkTIiU3DmoH22GMdjA//glGRRm4Umd9w89alBKzdPtLETbOCkMy7SliaJbRHMd+JTjxsSpKgaN22P288= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EO0+pQy8; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2bd816ecaf5so1678816a91.2; Wed, 22 May 2024 21:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716440000; x=1717044800; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=OvUrI2aaLqa4vMMuqwLUI/YBgeybzl+iDFgIbYUPxuE=; b=EO0+pQy8rLXbFwnx9UgknyMvS8t0l4g74DtArq34QkkNVM49n4q948Z8ZLNqTNABdY H2WlShXVpjLtTPQ+eaQVMG3NyfAihWbQw/6fvMkj8gGClfTa5w2XkIW7kL8ElqcmbQTA 18a18kUGee/pBEg0Ch/OCLrpKa0+YIyIeoy883nTc/dMcRNfUXDKKXkfFYbf0BGthJ1G XYbThCb5ztQmPvbK0KnyQcahpjw8ZaTlu12JcyxMWJZ5vn7nQdwL7PVxlRUEeAfjMF6i +rr1iys0d3yBqmPtLE/eNBvhQAr7yZvmyZafgCDlUQfKKhEA+CRI6pnbWcBEx/4xiAG3 pV1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716440000; x=1717044800; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OvUrI2aaLqa4vMMuqwLUI/YBgeybzl+iDFgIbYUPxuE=; b=YzQMXGrgMBjqKCrChit3lSpMzp15TFLPo63QJuBUqbv7KistfMzVM33mAq/2PIHE2q tUW/E2WJYh9BB2mOmD6nm+kTfXixJpMMYngyyYf8JVRVKhuF1b1YMDTuJQ4r3dswEyyN ooDC5pvxWIoQ+QtR0wbqafuMsPEKAMDgaGVpH5o8OJO3lrOmWis598+FT3JBqOarI/yC rcmRA9l7H/OF+LVFok/lrgrjxC2Uv4bR75ymc87t354Yijhd5m3y1O7/XfdA1JOQqVK+ O8UR685jrREvj4+HlDPfKuJOuC8gPGjuTZxoWYG4mSwPqaaS4cRH6RMWGa1gHeJfuaBU 5pfw== X-Forwarded-Encrypted: i=1; AJvYcCUnJFZrOJ8ovbdakx/gbNi1s7iZOq4iuTIWDqyX8KGZrFm+0WCMoT4qHg8WooOc+WLwJhycDzHwuBkmh30INlNMSQ4z4+R/NyoXseqiU25inpE1RCGRYW9Eu5fr0ghbYhFZn7bj9+SaHyjQY9dXhIwppSmQhjIn3cwvG1wADEwnHVOQGfY= X-Gm-Message-State: AOJu0YweR4y2T1FAu9PKW+BWD/tIpkOvgUHiwsHqP3Su5DUj8vbT7HGz f7IuKdS/CB9VQNiQRX5MppARyoiKUPBuo2ScgghObMat/CdYCejR X-Received: by 2002:a17:90a:ae03:b0:2b6:ab87:5e5b with SMTP id 98e67ed59e1d1-2bd9f45f37bmr3996717a91.9.1716440000028; Wed, 22 May 2024 21:53:20 -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 98e67ed59e1d1-2bdef6bcc14sm140184a91.13.2024.05.22.21.53.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 May 2024 21:53:19 -0700 (PDT) Sender: Guenter Roeck Message-ID: <1589de8b-3b81-422b-9b6f-e1b260b0a594@roeck-us.net> Date: Wed, 22 May 2024 21:53:17 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] drivers: hwmon: max31827: Add debugfs support To: =?UTF-8?Q?Nuno_S=C3=A1?= , Radu Sabau , Jean Delvare , Jonathan Corbet , linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240522123923.22320-1-radu.sabau@analog.com> <20240522123923.22320-3-radu.sabau@analog.com> <1c1519649f9c99ad73854b70efe286d68d200029.camel@gmail.com> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/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dertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <1c1519649f9c99ad73854b70efe286d68d200029.camel@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/22/24 06:10, Nuno Sá wrote: > On Wed, 2024-05-22 at 15:39 +0300, Radu Sabau wrote: >> Add debugfs support by creating directory in sys-fs which includes >> debugfs specific files used for configuring the device by >> preference. >> >> Signed-off-b: Radu Sabau >> --- >>  Documentation/hwmon/max31827.rst |  25 ++++ >>  drivers/hwmon/max31827.c         | 202 ++++++++++++++++++++++++++++++- >>  2 files changed, 225 insertions(+), 2 deletions(-) >> >> diff --git a/Documentation/hwmon/max31827.rst b/Documentation/hwmon/max31827.rst >> index 9c11a9518c67..940310be6075 100644 >> --- a/Documentation/hwmon/max31827.rst >> +++ b/Documentation/hwmon/max31827.rst >> @@ -142,3 +142,28 @@ usage (+33% for both write and reads) in normal conditions. >>  Since this operation implies there will be an extra delay to each >>  transaction, PEC can be disabled or enabled through sysfs. >>  Just write 1  to the "pec" file for enabling PEC and 0 for disabling it. >> + >> +DebugFs entries >> +--------------- >> + >> +The chip also has a configuration register where each bit stands for a specific >> +functionality to be configured. Hence as one would like to have access to these >> +features, we give access to them in debugfs. >> + >> +.. warning:: The debugfs interface is subject to change without notice >> +             and is only available when the kernel is compiled with >> +             ``CONFIG_DEBUG_FS`` defined. >> + >> +``/sys/kernel/debug/max31827/`` >> +contains the following attributes: >> + >> +==============  =============================================================== >> +alarm_polarity  Write 1 for ALARM pin active state is low, 0 otherwise >> +comp_int        Set to 1 if OT and UT status bits are in interrupt mode >> +fault_queue     Number of consecutive temperature faults until OT and UT faults >> +                are indicated in status bits >> +pec_error       Set to 1 if PEC Enable bit is set, 0 otherwise >> +resolution      2-bit value that select the conversion resolution, please see >> +                datasheet for corresponding values >> +timeout         Write 1 do disable bus timeout, 0 otherwise > >>From the description, the above really don't look like they belong into a debug > interface... > Correct. The chip should be configured using firmware properties, which for the most part is already supported. An acceptable exception is PEC, but that configuration flag, if implemented as attribute, should be attached to the i2c client interface to match other drivers. Guenter