Re: [PATCH v4 2/2] rtc: max31335: add driver support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/1/23 08:21, Miclaus, Antoniu wrote:
On Wed, Nov 01, 2023 at 11:48:14AM +0200, Antoniu Miclaus wrote:
RTC driver for MAX31335 ±2ppm Automotive Real-Time Clock with
Integrated MEMS Resonator.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx>
---
changes in v4:
  - add Kconfig entry for HWMON dependency.
  MAINTAINERS                |   8 +
  drivers/rtc/Kconfig        |  20 +
  drivers/rtc/Makefile       |   1 +
  drivers/rtc/rtc-max31335.c | 765
+++++++++++++++++++++++++++++++++++++
  4 files changed, 794 insertions(+)
  create mode 100644 drivers/rtc/rtc-max31335.c

diff --git a/MAINTAINERS b/MAINTAINERS
index dd5de540ec0b..bc484cb997ab 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12823,6 +12823,14 @@ F:
	Documentation/devicetree/bindings/hwmon/adi,max31827.yaml
  F:	Documentation/hwmon/max31827.rst
  F:	drivers/hwmon/max31827.c

+MAX31335 RTC DRIVER
+M:	Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx>
+L:	linux-rtc@xxxxxxxxxxxxxxx
+S:	Supported
+W:	https://ez.analog.com/linux-software-drivers
+F:	Documentation/devicetree/bindings/rtc/adi,max31335.yaml
+F:	drivers/rtc/rtc-max31335.c
+
  MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
  L:	linux-hwmon@xxxxxxxxxxxxxxx
  S:	Orphan
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index d7502433c78a..360da13fe61b 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -373,6 +373,26 @@ 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.
+
+config RTC_DRV_MAX31335_HWMON
+	bool "HWMON support for Analog Devices MAX31335"
+	depends on RTC_DRV_MAX31335 && HWMON
+	depends on !(RTC_DRV_MAX31335=y && HWMON=m)
+	default y
+	help
+	  Say Y here if you want to expose temperature sensor data on
+	  rtc-max31335.
+

This isn't used in the driver. Did you test with HWMON=n ?


I need to start thinking a bit more out of the box instead of
taking other driver approaches as being the only way to go. 😊


There are essentially two options: Either the above, or use
	depends on HWMON || HWMON=n
for RTC_DRV_MAX31335.

In both cases, the driver hwmon code has to be surrounded with #if[def].
Depending on your approach, that will be "#ifdef RTC_DRV_MAX31335_HWMON"
or "#if IS_REACHABLE(HWMON)".

You could also use "depends on HWMON" for RTC_DRV_MAX31335 to avoid the
#ifdef in the driver, but that is normally undesirable.

Guenter




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux