Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp343664rdb; Tue, 31 Oct 2023 09:01:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0cm8gHQLxbM08V8P6X1LDaZ/jnvVKG/4D0b7x//b7AXUtbVSEezND0mXZi5BU0V6Q0asu X-Received: by 2002:a17:902:6b89:b0:1cc:6101:20c7 with SMTP id p9-20020a1709026b8900b001cc610120c7mr3445146plk.46.1698768094645; Tue, 31 Oct 2023 09:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698768094; cv=none; d=google.com; s=arc-20160816; b=QSkxXOtxJoNe7Z5Zni+QLdrJFdYTcdYosbqibOmLG4DMCfbOqiMVZ+hrAc6tA76nik k6Pmi5GfeLk+/WjvxK8HMdn1GWVlrdv3aZ3rVdr2KLckCL6hvkXAKRkxLL4/GuH4oS9s cEfCMYbKUzdj+NoglTekWo9F2v1zvqzhPVxZUcHD5Y4sTMqYjo+8LGlwbjay6QP3kFNY A+ibIWnTTBxp+KeaIcsc5413TsgHOE85/6VdILUgNpi7oPso/t314PS+uBlMVQvJgio7 rK9QiEsDFhYrebmpQG0tjGkhW2HK+xQWUj+aZ0Okpt8wSDmKyRjnODx1db3KxvJ/BZSQ WAaQ== 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:autocrypt :from:references:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=fSkWUAaL15CpGTewW928PS3JdYXegcRfmO7SVs8ug3U=; fh=6pBHbK4ZKKOwzlk69k/YS8j1uiIOLTJN2QLzZ+Izqxg=; b=JULyRtUX77t70L+d+No+23twwroMf0XBK2B46gW6QJeqft+kNagdkLIHQECKaJr+3H LamqDGd23M5B8C5qolm54GOd1KlC2T0jIZQa3oy6M5BzjPTZKZsOK+vk+DAlXW8awpb4 G8JxpcacqqrWKyTH5DFrUGStvrljt47+hm0TAGLpZamhI6GfcrGJSsubTq6YZZ60OeVC zFLdr2nHQJuB8Gh6CdrJ9ffhesC3x+76QHQJxihsA6ask1Cenab3HM5zylSA1gV5EoNg P8HCWWSJnIR3f/Z2SLH7VcJGaHfzDrk1//8THI9p10v/Z2hFd0mMdjm33G3v9O6e+Ns8 aXuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TRow5zti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j2-20020a63e742000000b005b99683f21fsi1175464pgk.760.2023.10.31.09.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:01:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TRow5zti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id ED5098038B01; Tue, 31 Oct 2023 09:01:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344824AbjJaQBY (ORCPT + 99 others); Tue, 31 Oct 2023 12:01:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344808AbjJaQBW (ORCPT ); Tue, 31 Oct 2023 12:01:22 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A968BE6; Tue, 31 Oct 2023 09:01:19 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b9af7d41d2so5155643b3a.0; Tue, 31 Oct 2023 09:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698768079; x=1699372879; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=fSkWUAaL15CpGTewW928PS3JdYXegcRfmO7SVs8ug3U=; b=TRow5zti8xTzIPlcclFjqenjSiCADQaddGpaiA8zxM9+z9ycMSdP5cVEadTi6Jz139 I6eeZVIZbXTKV3qcaAlfUugM/gZ0sAoLE/r5Bx8InPwcIGs448bONdOlVfh1cp9xvr2L WYo8QiWLTSd9Ceq8x55KWrzbOpqX6jFHs5N7PiNbgejOCh9JITn6iupXWf4lIdbrHJUw r562goY3ZNQ8S9QlD4ZrgqaJ3o1ALv8TwU6GkKeR4qj17zKpYi1447+HCsg+mJiPgX6H DZTSXj9rpSZTTRsd4N7hYd3ohKiNTVMxVl0CNOLb9nsjqmSiM60lXfWngAEIfbSiYCsK SUlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698768079; x=1699372879; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fSkWUAaL15CpGTewW928PS3JdYXegcRfmO7SVs8ug3U=; b=j0F0pwdKTm3PtQlTNoGCbqtPHr0XC/gvbEum4ONIjJywDQJs1dz0mdEZ7Ye7jJ2cwx wAA4jY//7mT+9zGzGhhoMzEprKRiA/f8GWHFyiQIiAzAcLJeztU57pKgNFH3ugfDwxxf ZCrvN/hVgJ6K/mjvywdMWQMRAtas8qJkBjNEYNr48hkD3JWV7E6fFOz5dm53TZMRDTN5 Ri9p4A6GSaEfThKD03h194qUg5UVdEIrVrNJF1QJ+axWI/lkxB9oFtmzDClwLp6PRlqG DOaq97QJNiGzuPjVg84rlJ7KMQEZwv2bPxMcep8H8+wOyZEPtUjSnU23WrJivBIHz99h wY3Q== X-Gm-Message-State: AOJu0YyyYaoAHeSDtWhFmHgJEvVAeuJomd+yPotR094qMxb++y1eQFtU ceuHBzanNZPFJcmyiyoXosM= X-Received: by 2002:a05:6a20:3956:b0:17f:66f7:e079 with SMTP id r22-20020a056a20395600b0017f66f7e079mr13674944pzg.19.1698768078850; Tue, 31 Oct 2023 09:01:18 -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 c25-20020a637259000000b0058a9621f583sm1242444pgn.44.2023.10.31.09.01.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Oct 2023 09:01:17 -0700 (PDT) Sender: Guenter Roeck Message-ID: <95e41f16-4b5f-4f2a-bc31-17273032312b@roeck-us.net> Date: Tue, 31 Oct 2023 09:01:16 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] rtc: max31335: add driver support Content-Language: en-US To: Antoniu Miclaus , Alessandro Zummo , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jean Delvare , linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org References: <20231031153100.92939-1-antoniu.miclaus@analog.com> <20231031153100.92939-2-antoniu.miclaus@analog.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ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WOUGY HhQ5eqTRZjm9z+qQe/T0HQpmiPTqQcIaG/edgKVTUjITfA7AJMKLQHgp04Vylb+G6jocnQQX JqvvP09whbqrABEBAAHCwWUEGAECAA8CGwwFAlVcpi8FCRmg08MACgkQyx8mb86fmYHNRQ/+ J0OZsBYP4leJvQF8lx9zif+v4ZY/6C9tTcUv/KNAE5leyrD4IKbnV4PnbrVhjq861it/zRQW cFpWQszZyWRwNPWUUz7ejmm9lAwPbr8xWT4qMSA43VKQ7ZCeTQJ4TC8kjqtcbw41SjkjrcTG wF52zFO4bOWyovVAPncvV9eGA/vtnd3xEZXQiSt91kBSqK28yjxAqK/c3G6i7IX2rg6pzgqh hiH3/1qM2M/LSuqAv0Rwrt/k+pZXE+B4Ud42hwmMr0TfhNxG+X7YKvjKC+SjPjqp0CaztQ0H nsDLSLElVROxCd9m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20231031153100.92939-2-antoniu.miclaus@analog.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 09:01:28 -0700 (PDT) On 10/31/23 08:30, Antoniu Miclaus wrote: > RTC driver for MAX31335 ±2ppm Automotive Real-Time Clock with > Integrated MEMS Resonator. > > Signed-off-by: Antoniu Miclaus > --- > changes in v3: > - drop MAX31335_STATUS1 register check inside probe function. > drivers/rtc/Kconfig | 11 + > drivers/rtc/Makefile | 1 + > drivers/rtc/rtc-max31335.c | 765 +++++++++++++++++++++++++++++++++++++ > 3 files changed, 777 insertions(+) > create mode 100644 drivers/rtc/rtc-max31335.c > > diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig > index d7502433c78a..11c7d7fe1e85 100644 > --- a/drivers/rtc/Kconfig > +++ b/drivers/rtc/Kconfig > @@ -373,6 +373,17 @@ config RTC_DRV_MAX8997 > This driver can also be built as a module. If so, the module > will be called rtc-max8997. > > +config RTC_DRV_MAX31335 > + tristate "Analog Devices MAX31335" > + depends on I2C > + select REGMAP_I2C > + help > + If you say yes here you get support for the Analog Devices > + MAX31335. > + > + This driver can also be built as a module. If so, the module > + will be called rtc-max31335. > + Just out of curiosity, is this an unreleased chip ? I only find MAX311331 and MAX31334 on the Analog website, but the register map for those is different, and they don't support reporting the chip temperature. [ ... ] > + > +static const struct hwmon_channel_info *max31335_info[] = { > + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), According to the register map above, the chip does support low and high temperature limits as well as over- and undertemperature alarms and interrupts. I would suggest to add support for all of those. You might also consider adding support for temperature alarm interrupts and report temperature alarm events by calling hwmon_notify_event() if a thermal event occurs. [ ... ] > + > + hwmon = devm_hwmon_device_register_with_info(&client->dev, client->name, > + max31335, > + &max31335_chip_info, > + NULL); There is no "depends on HWMON" in the Kconfig entry, meaning this will fail to compile if HWMON=n or if HWMON=m and RTC_DRV_MAX31335=y. Guenter