Received: by 2002:ab2:7853:0:b0:1fa:5c73:8e2d with SMTP id m19csp17159lqp; Thu, 30 May 2024 10:34:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6Zd2ireYferGMHH/twCZw9fNJ4J5yqS8ow3RmHpdJWa7YCFmUR/KiJrHgHHTH6jibdInOTDp8XfRNG3xysVlTJoAn5skjEz3HrlWMcg== X-Google-Smtp-Source: AGHT+IFaydPSc9w+yMKgbFVX4ZLwcXhHEUwH26B/7JUe6elh1896IqicfkhzgRLrPFu5m3WXFbF2 X-Received: by 2002:a05:6a00:1f0a:b0:6f8:b83f:d433 with SMTP id d2e1a72fcca58-70231101f0bmr2891770b3a.8.1717090456015; Thu, 30 May 2024 10:34:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717090456; cv=pass; d=google.com; s=arc-20160816; b=ZmPuvldouOiiN+j/QqYVx23W+7mueULgVH849N9DITh/pFpNb/T015mo5et1jTouvt S1XMPEyQ5xGxLcyBDzmyDFpaXr38ilRSle8+5tyf0rhs60e9fBKc/nKGEHIvrK0pM8Ng 4DKQlnz4P5BYlU4Ubtk/YyrGxfCIrCBdjPAktTyOQOvbeHcqALgtl6jHY4oJspZRT0a5 JSv3J6XkFN4uwuOj02lzQitVwETYDvdj4sFugbaVQ5Wsw7eSz0fDwM5se9JPx5ScQ6Tg o0Y7C9J0oZHNLuvbRhkxvz5/cGMR742JnyN6jt1ipM36LVwB8N+YJSFyGlh14hkY+cAR 8jTw== 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:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=8cQQIq4Vk18SQ+o1x8PKCLBm75kv15P7l74WYPsGX94=; fh=fTrUKsOVONzzNG93le4U2UbpnjVefL6FssGwzpWQLks=; b=CgFAkikHUxOqoqISxu41uIO8EGaCiupMqT9inxrDO8UduA5Geme40+gC4vvRUj5K6x GaTZ44IAUn34jC212KXTWkdis41XrwHCiSOQm3k/q8p+cj5GdjZf8WcGf0aqqvayO6V8 M7P3yJZeXED4AqaZn2TxtSwS/bhiZKvyY9KcsbCZgcy6cgLK/Cixpyb/t/edG5JeVL0C YBmUSSJL93BLJCaA6jUnW1WEHFNgqXaQAMoWgQpbN5uQmq5CpA4na+aoMJaD7qJ14U9E qs2LJVa8UnpspDSCk6UKHFcUpK/m8hUYRpP38PWMLMzBphO6qypxQaBVFs/IoQK8V4lN 4rNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YB2JEQHH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195736-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195736-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-702426136f9si25907b3a.131.2024.05.30.10.34.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 10:34:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195736-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YB2JEQHH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195736-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195736-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D667BB234F9 for ; Thu, 30 May 2024 17:34:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 003FA4655F; Thu, 30 May 2024 17:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YB2JEQHH" Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 77D6317F5; Thu, 30 May 2024 17:33:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717090441; cv=none; b=nLzFYD5+8lM1+/AgJm3VE1dQujihSyFN+OjElWXzewI+tuEeAxfv4tX8reD14Zz9mFuID5SeD5sj/f2vulqiQ0G1TsHMCLyHAFUBGH4VWIm0oUcP95DM9BgSwmcb4AtYaKaiSCZtoA+EdbsJEt8xU4h1ZcDBGyq6UVfsvsLd5s0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717090441; c=relaxed/simple; bh=o2WA8Dt+5T27wsfAT64ZKn7et1NXfcL6ZG1iOLp5Kgk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FH4GOX6wRp4gLlXEt2E+obrYxlkdFGMFl4Hanq1PldXKka03QZVVi9nRIFeBbL4F7qofPZcwRbbyZK3G2BeaKYbqW3WFInYZhu6E1shQSZBGkaQCOlfJvRLq0Lgg3wRdyyj6Eb4eNT6dzyGYD0Bmf8c+G0a8D0/jJbcTGdLBnug= 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=YB2JEQHH; arc=none smtp.client-ip=209.85.210.169 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-pf1-f169.google.com with SMTP id d2e1a72fcca58-70109d34a16so1061540b3a.2; Thu, 30 May 2024 10:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717090439; x=1717695239; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=8cQQIq4Vk18SQ+o1x8PKCLBm75kv15P7l74WYPsGX94=; b=YB2JEQHHHow0Lwia4061krdK4Dz1OTbvDLWwH4kyNsZm+bWmjAHn8nAfDFfCE7QRwF sI9ypf6/48ajSnHN5D4FwDmK32Tiy+/ohd7V7GcZV3Q3L28B76jlbVWJ6uuGR+cUvKE5 jbBKseLoHp4JIsz+Y3l0qF2hBANP8PZFZ+cwGonenCfvW/ZP9lQN8a8JMUEIOunb3ITB WR3NRYEIFTcVE+76WvME+xpiMRyMe4C0yqViDexYO6np2tb37PSisi3D3MkBpu8cwSW/ d6+JmaIYD2XjGoQ8HotSux8cGqErdVTjQJ4CXwluKts34/ZBebGqzGa1bytOQ+FvFhNV nqpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717090439; x=1717695239; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8cQQIq4Vk18SQ+o1x8PKCLBm75kv15P7l74WYPsGX94=; b=qxK1CfMwVPbON8eqAVIZ+p0e3hQofgi9b/JeweTmkLqoFM93MoweEuU6EkHUNqEvqU FocEo6M6OesyMndaTeHp9K4N5V8BQhLlS9/0vKdHzurJ5DWsHW2I/r/sizjQpkJMZbvb WxNsGPHy+/j738WqMkc9DiMe0bdZGYhFC1irpkWZWBwa6UdgXNgG9aUVb8N4Lp1m4gK3 tBAkoTziqe116glAs5n5cmrSa385IfsFxwRsFEa8ntXKy9cZhrDemvxkXnEAGyYUEFuy xS7xncAwamHrPjNsRW0i4ofUPs3A6JZsSPujKwq3SyAcBruxtW62wcUbwmoxS/69njHk QehA== X-Forwarded-Encrypted: i=1; AJvYcCV4hwxqJPmAwgGyUvlPK2Puwcz8/bLCE/tlZjMS74hO588IjsM0DUJoejv//N9iLlwV3Bh+yn2fflepWClfvUyAoBY0ooo+mV9KhI6Zm4lMVotHa8v302//4IAzyy8lQ1p5KMnSts6j4IIcqo7Pp5Y9V9eH2ix+e6ksZpUrs0CUqghVaB02 X-Gm-Message-State: AOJu0YzZmMvMJg23tH4qXViKHrwIj0hUexgtISTW7tTZi4tgT0RqGGXS WYVnhb0g3aVMErBSAdsY+qTzzypCmNWJFnd7xB7cZRjmfuo0AzDe X-Received: by 2002:a17:902:f2cb:b0:1f4:ac10:3ede with SMTP id d9443c01a7336-1f6195f4a9bmr19639955ad.21.1717090438497; Thu, 30 May 2024 10:33:58 -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 d9443c01a7336-1f6323feaa0sm404355ad.230.2024.05.30.10.33.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 May 2024 10:33:57 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Thu, 30 May 2024 10:33:55 -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/3] hwmon: Add support for SPD5118 compliant temperature sensors To: Armin Wolf , linux-hwmon@vger.kernel.org Cc: Hristo Venev , =?UTF-8?Q?Ren=C3=A9_Rebe?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Radu Sabau References: <20240529205204.81208-1-linux@roeck-us.net> <20240529205204.81208-3-linux@roeck-us.net> <6f1ffb83-a64f-469d-b981-f0da0d2f02ac@gmx.de> 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/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+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Cn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <6f1ffb83-a64f-469d-b981-f0da0d2f02ac@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/30/24 10:03, Armin Wolf wrote: > Am 29.05.24 um 22:52 schrieb Guenter Roeck: > [ ... ] >> + >> +temp1_lcrit_alarm    Temperature low critical alarm >> +temp1_min_alarm        Temperature low alarm >> +temp1_max_alarm        Temperature high alarm >> +temp1_crit_alarm    Temperature critical alarm > > Maybe it would be a good idea to tell users that the alarm attributes are sticky. > The driver auto-clears them after read, so they are only sticky in the sense that they will remain active until read. This is quite common for hardware monitoring devices. However, sure, I'll add a note. [ ... ] >> +static int spd5118_write_enable(struct regmap *regmap, u32 attr, long val) >> +{ >> +    if (val && val != 1) >> +        return -EINVAL; >> + >> +    return regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG, >> +                  SPD5118_TS_DISABLE, >> +                  val ? 0 : SPD5118_TS_DISABLE); > > The spd5118 spec says that we have to wait 10ms after enabling the sensors before > we start reading temperature values, maybe we need a delay + locking here? > I don't think that would add much if any value but a lot of complexity for little gain. I find it acceptable that the sensor returns 0 for a few ms after enabling it. Pretty much all chips have the same problem, so I am really not concerned about it. >> + >> +static struct i2c_driver spd5118_driver = { >> +    .class        = I2C_CLASS_HWMON, >> +    .driver = { >> +        .name    = "spd5118", >> +        .of_match_table = spd5118_of_ids, > > The driver is missing suspend support, without it hibernation/S4 sleep will cause the > limit and config registers to be out of sync with the regmap cache. > Good point. Do you have a means to test this if I add suspend support ? I have not been able to figure out how to put my system into suspend. Thanks, Guenter