devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
@ 2023-12-18  4:52 Abdel Alkuor
  2023-12-18  4:52 ` [PATCH v2 2/2] " Abdel Alkuor
  2023-12-19 15:18 ` [PATCH v2 1/2] dt-bindings: " Conor Dooley
  0 siblings, 2 replies; 10+ messages in thread
From: Abdel Alkuor @ 2023-12-18  4:52 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet
  Cc: Abdel Alkuor, linux-hwmon, devicetree, linux-kernel, linux-doc

as6200 is a temperature sensor with a range between -40°C to
125°C degrees and an accuracy of ±0.4°C degree between 0
and 65°C and ±1°C for the other ranges.

Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
---
Changes in v2:
  - Incorporate as6200 into lm75 bindings

 .../devicetree/bindings/hwmon/lm75.yaml        | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
index 0b69897f0c63..63b85a83ac18 100644
--- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
+++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
@@ -14,6 +14,7 @@ properties:
   compatible:
     enum:
       - adi,adt75
+      - ams,as6200
       - atmel,at30ts74
       - dallas,ds1775
       - dallas,ds75
@@ -48,6 +49,9 @@ properties:
   vs-supply:
     description: phandle to the regulator that provides the +VS supply
 
+  interrupts:
+    maxItems: 1
+
 required:
   - compatible
   - reg
@@ -66,3 +70,17 @@ examples:
         vs-supply = <&vs>;
       };
     };
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        temperature-sensor@48 {
+            compatible = "ams,as6200";
+            reg = <0x48>;
+            vs-supply = <&vs>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <17 IRQ_TYPE_EDGE_BOTH>;
+        };
+    };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/2] hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-18  4:52 [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor Abdel Alkuor
@ 2023-12-18  4:52 ` Abdel Alkuor
  2023-12-18 17:00   ` kernel test robot
  2023-12-18 17:37   ` Guenter Roeck
  2023-12-19 15:18 ` [PATCH v2 1/2] dt-bindings: " Conor Dooley
  1 sibling, 2 replies; 10+ messages in thread
From: Abdel Alkuor @ 2023-12-18  4:52 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet
  Cc: Abdel Alkuor, linux-hwmon, devicetree, linux-kernel, linux-doc

as6200 is a temperature sensor with 0.0625°C resolution and a
range between -40°C to 125°C.

By default, the driver configures as6200 as following:
- Converstion rate: 8 Hz
- Conversion mode: continuous
- Consecutive fault counts: 4 samples
- Alert state: high polarity
- Alert mode: comparator mode

Interrupt is supported for the alert pin.

Datasheet: https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
---
Changes in v2:
  - Incorporate as6200 into lm75 driver

 Documentation/hwmon/lm75.rst |  10 +++
 drivers/hwmon/lm75.c         | 132 +++++++++++++++++++++++++++++------
 2 files changed, 122 insertions(+), 20 deletions(-)

diff --git a/Documentation/hwmon/lm75.rst b/Documentation/hwmon/lm75.rst
index 8d0ab4ad5fb5..6adab608dd05 100644
--- a/Documentation/hwmon/lm75.rst
+++ b/Documentation/hwmon/lm75.rst
@@ -133,6 +133,16 @@ Supported chips:
 
                https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf
 
+  * AMS OSRAM AS6200
+
+    Prefix: 'as6200'
+
+    Addresses scanned: none
+
+    Datasheet: Publicly available at the AMS website
+
+               https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
+
 Author: Frodo Looijaard <frodol@dds.nl>
 
 Description
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 5b2ea05c951e..2d153f6729e0 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -7,6 +7,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
@@ -25,6 +26,7 @@
 
 enum lm75_type {		/* keep sorted in alphabetical order */
 	adt75,
+	as6200,
 	at30ts74,
 	ds1775,
 	ds75,
@@ -55,6 +57,7 @@ enum lm75_type {		/* keep sorted in alphabetical order */
 
 /**
  * struct lm75_params - lm75 configuration parameters.
+ * @config_reg_16bits	Configure register size is 2 bytes.
  * @set_mask:		Bits to set in configuration register when configuring
  *			the chip.
  * @clr_mask:		Bits to clear in configuration register when configuring
@@ -75,17 +78,20 @@ enum lm75_type {		/* keep sorted in alphabetical order */
  * @sample_times:	All the possible sample times to be set. Mandatory if
  *			num_sample_times is larger than 1. If set, number of
  *			entries must match num_sample_times.
+ * @alarm		Alarm is supported.
  */
 
 struct lm75_params {
-	u8			set_mask;
-	u8			clr_mask;
+	bool			config_reg_16bits;
+	u16			set_mask;
+	u16			clr_mask;
 	u8			default_resolution;
 	u8			resolution_limits;
 	const u8		*resolutions;
 	unsigned int		default_sample_time;
 	u8			num_sample_times;
 	const unsigned int	*sample_times;
+	bool			alarm;
 };
 
 /* Addresses scanned */
@@ -104,8 +110,8 @@ struct lm75_data {
 	struct i2c_client		*client;
 	struct regmap			*regmap;
 	struct regulator		*vs;
-	u8				orig_conf;
-	u8				current_conf;
+	u16				orig_conf;
+	u16				current_conf;
 	u8				resolution;	/* In bits, 9 to 16 */
 	unsigned int			sample_time;	/* In ms */
 	enum lm75_type			kind;
@@ -128,6 +134,15 @@ static const struct lm75_params device_params[] = {
 		.default_resolution = 12,
 		.default_sample_time = MSEC_PER_SEC / 10,
 	},
+	[as6200] = {
+		.config_reg_16bits = true,
+		.set_mask = 0x94C0,	/* 8 sample/s, 4 CF, positive polarity */
+		.default_resolution = 12,
+		.default_sample_time = 125,
+		.num_sample_times = 4,
+		.sample_times = (unsigned int []){ 125, 250, 1000, 4000 },
+		.alarm = true,
+	},
 	[at30ts74] = {
 		.set_mask = 3 << 5,	/* 12-bit mode*/
 		.default_resolution = 12,
@@ -317,20 +332,23 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
 	return ((temp >> (16 - resolution)) * 1000) >> (resolution - 8);
 }
 
-static int lm75_write_config(struct lm75_data *data, u8 set_mask,
-			     u8 clr_mask)
+static int lm75_write_config(struct lm75_data *data, u16 set_mask,
+			     u16 clr_mask)
 {
-	u8 value;
+	unsigned int value;
 
-	clr_mask |= LM75_SHUTDOWN;
+	clr_mask |= LM75_SHUTDOWN << (8 * data->params->config_reg_16bits);
 	value = data->current_conf & ~clr_mask;
 	value |= set_mask;
 
 	if (data->current_conf != value) {
 		s32 err;
-
-		err = i2c_smbus_write_byte_data(data->client, LM75_REG_CONF,
-						value);
+		if (data->params->config_reg_16bits)
+			err = regmap_write(data->regmap, LM75_REG_CONF, value);
+		else
+			err = i2c_smbus_write_byte_data(data->client,
+							LM75_REG_CONF,
+							value);
 		if (err)
 			return err;
 		data->current_conf = value;
@@ -338,6 +356,33 @@ static int lm75_write_config(struct lm75_data *data, u8 set_mask,
 	return 0;
 }
 
+static int lm75_read_config(struct lm75_data *data, u16 *config)
+{
+	int ret;
+	unsigned int status;
+
+	if (data->params->config_reg_16bits) {
+		ret = regmap_read(data->regmap, LM75_REG_CONF, &status);
+	} else {
+		ret = i2c_smbus_read_byte_data(data->client, LM75_REG_CONF);
+		status = ret;
+	}
+
+	if (ret < 0)
+		return ret;
+
+	*config = status;
+	return 0;
+}
+
+static irqreturn_t lm75_alarm_handler(int irq, void *private)
+{
+	struct device *hwmon_dev = private;
+
+	hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_alarm, 0);
+	return IRQ_HANDLED;
+}
+
 static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
 		     u32 attr, int channel, long *val)
 {
@@ -366,6 +411,9 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
 		case hwmon_temp_max_hyst:
 			reg = LM75_REG_HYST;
 			break;
+		case hwmon_temp_alarm:
+			reg = LM75_REG_CONF;
+			break;
 		default:
 			return -EINVAL;
 		}
@@ -373,7 +421,17 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
 		if (err < 0)
 			return err;
 
-		*val = lm75_reg_to_mc(regval, data->resolution);
+		if (attr == hwmon_temp_alarm) {
+			switch (data->kind) {
+			case as6200:
+				*val = (regval >> 5) & 0x1;
+				break;
+			default:
+				return -EINVAL;
+			}
+		} else {
+			*val = lm75_reg_to_mc(regval, data->resolution);
+		}
 		break;
 	default:
 		return -EINVAL;
@@ -436,6 +494,7 @@ static int lm75_update_interval(struct device *dev, long val)
 			data->resolution = data->params->resolutions[index];
 		break;
 	case tmp112:
+	case as6200:
 		err = regmap_read(data->regmap, LM75_REG_CONF, &reg);
 		if (err < 0)
 			return err;
@@ -503,6 +562,9 @@ static umode_t lm75_is_visible(const void *data, enum hwmon_sensor_types type,
 		case hwmon_temp_max:
 		case hwmon_temp_max_hyst:
 			return 0644;
+		case hwmon_temp_alarm:
+			if (config_data->params->alarm)
+				return 0444;
 		}
 		break;
 	default:
@@ -515,7 +577,8 @@ static const struct hwmon_channel_info * const lm75_info[] = {
 	HWMON_CHANNEL_INFO(chip,
 			   HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
 	HWMON_CHANNEL_INFO(temp,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
+			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST |
+			   HWMON_T_ALARM),
 	NULL
 };
 
@@ -574,7 +637,7 @@ static int lm75_probe(struct i2c_client *client)
 	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct lm75_data *data;
-	int status, err;
+	int err;
 	enum lm75_type kind;
 
 	if (client->dev.of_node)
@@ -623,13 +686,13 @@ static int lm75_probe(struct i2c_client *client)
 		return err;
 
 	/* Cache original configuration */
-	status = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
-	if (status < 0) {
-		dev_dbg(dev, "Can't read config? %d\n", status);
-		return status;
+	err = lm75_read_config(data, &data->current_conf);
+	if (err) {
+		dev_dbg(dev, "Can't read config? %d\n", err);
+		return err;
 	}
-	data->orig_conf = status;
-	data->current_conf = status;
+
+	data->orig_conf = data->current_conf;
 
 	err = lm75_write_config(data, data->params->set_mask,
 				data->params->clr_mask);
@@ -646,6 +709,30 @@ static int lm75_probe(struct i2c_client *client)
 	if (IS_ERR(hwmon_dev))
 		return PTR_ERR(hwmon_dev);
 
+	if (client->irq) {
+		if (data->params->alarm) {
+			err = devm_request_threaded_irq(dev,
+							client->irq,
+							NULL,
+							&lm75_alarm_handler,
+							IRQF_ONESHOT,
+							client->name,
+							hwmon_dev);
+			if (err)
+				return err;
+		} else {
+			/*
+			 * Currently, alarm is only supported for chips with
+			 * alarm bit.
+			 * In the future, if alarm is needed for chips with
+			 * no alarm bit, current temp needs to be compared
+			 * against the max and max hyst values to set/clear
+			 * the alarm state.
+			 */
+			dev_warn(dev, "alarm interrupt is not supported\n");
+		}
+	}
+
 	dev_info(dev, "%s: sensor '%s'\n", dev_name(hwmon_dev), client->name);
 
 	return 0;
@@ -654,6 +741,7 @@ static int lm75_probe(struct i2c_client *client)
 static const struct i2c_device_id lm75_ids[] = {
 	{ "adt75", adt75, },
 	{ "at30ts74", at30ts74, },
+	{ "as6200", as6200, },
 	{ "ds1775", ds1775, },
 	{ "ds75", ds75, },
 	{ "ds7505", ds7505, },
@@ -689,6 +777,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = {
 		.compatible = "adi,adt75",
 		.data = (void *)adt75
 	},
+	{
+		.compatible = "ams,as6200",
+		.data = (void *)as6200
+	},
 	{
 		.compatible = "atmel,at30ts74",
 		.data = (void *)at30ts74
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/2] hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-18  4:52 ` [PATCH v2 2/2] " Abdel Alkuor
@ 2023-12-18 17:00   ` kernel test robot
  2023-12-18 17:37   ` Guenter Roeck
  1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2023-12-18 17:00 UTC (permalink / raw)
  To: Abdel Alkuor, Jean Delvare, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet
  Cc: oe-kbuild-all, Abdel Alkuor, linux-hwmon, devicetree,
	linux-kernel, linux-doc

Hi Abdel,

kernel test robot noticed the following build warnings:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on robh/for-next linus/master v6.7-rc6 next-20231218]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Abdel-Alkuor/hwmon-lm75-Add-AMS-AS6200-temperature-sensor/20231218-125552
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/a71ac5106e022b526bef9fc375bd5d3f547eb19d.1702874115.git.alkuor%40gmail.com
patch subject: [PATCH v2 2/2] hwmon: (lm75) Add AMS AS6200 temperature sensor
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20231219/202312190037.v9VmHXF6-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312190037.v9VmHXF6-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312190037.v9VmHXF6-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/hwmon/lm75.c:95: warning: Function parameter or member 'config_reg_16bits' not described in 'lm75_params'
>> drivers/hwmon/lm75.c:95: warning: Function parameter or member 'alarm' not described in 'lm75_params'


vim +95 drivers/hwmon/lm75.c

9ebd3d822efeca David Brownell                  2008-05-03  57  
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  58  /**
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  59   * struct lm75_params - lm75 configuration parameters.
08760063a75ca5 Abdel Alkuor                    2023-12-17  60   * @config_reg_16bits	Configure register size is 2 bytes.
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  61   * @set_mask:		Bits to set in configuration register when configuring
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  62   *			the chip.
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  63   * @clr_mask:		Bits to clear in configuration register when configuring
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  64   *			the chip.
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  65   * @default_resolution:	Default number of bits to represent the temperature
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  66   *			value.
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  67   * @resolution_limits:	Limit register resolution. Optional. Should be set if
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  68   *			the resolution of limit registers does not match the
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  69   *			resolution of the temperature register.
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  70   * @resolutions:	List of resolutions associated with sample times.
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  71   *			Optional. Should be set if num_sample_times is larger
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  72   *			than 1, and if the resolution changes with sample times.
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  73   *			If set, number of entries must match num_sample_times.
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  74   * @default_sample_time:Sample time to be set by default.
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  75   * @num_sample_times:	Number of possible sample times to be set. Optional.
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  76   *			Should be set if the number of sample times is larger
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  77   *			than one.
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  78   * @sample_times:	All the possible sample times to be set. Mandatory if
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  79   *			num_sample_times is larger than 1. If set, number of
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  80   *			entries must match num_sample_times.
08760063a75ca5 Abdel Alkuor                    2023-12-17  81   * @alarm		Alarm is supported.
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  82   */
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  83  
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  84  struct lm75_params {
08760063a75ca5 Abdel Alkuor                    2023-12-17  85  	bool			config_reg_16bits;
08760063a75ca5 Abdel Alkuor                    2023-12-17  86  	u16			set_mask;
08760063a75ca5 Abdel Alkuor                    2023-12-17  87  	u16			clr_mask;
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  88  	u8			default_resolution;
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  89  	u8			resolution_limits;
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  90  	const u8		*resolutions;
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  91  	unsigned int		default_sample_time;
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  92  	u8			num_sample_times;
7f1a300f8abd11 Iker Perez del Palomar Sustatxa 2019-08-08  93  	const unsigned int	*sample_times;
08760063a75ca5 Abdel Alkuor                    2023-12-17  94  	bool			alarm;
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08 @95  };
dcb12653875e7c Iker Perez del Palomar Sustatxa 2019-08-08  96  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/2] hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-18  4:52 ` [PATCH v2 2/2] " Abdel Alkuor
  2023-12-18 17:00   ` kernel test robot
@ 2023-12-18 17:37   ` Guenter Roeck
  1 sibling, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2023-12-18 17:37 UTC (permalink / raw)
  To: Abdel Alkuor, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet
  Cc: linux-hwmon, devicetree, linux-kernel, linux-doc

On 12/17/23 20:52, Abdel Alkuor wrote:
> as6200 is a temperature sensor with 0.0625°C resolution and a
> range between -40°C to 125°C.
> 
> By default, the driver configures as6200 as following:
> - Converstion rate: 8 Hz
> - Conversion mode: continuous
> - Consecutive fault counts: 4 samples
> - Alert state: high polarity
> - Alert mode: comparator mode
> 
> Interrupt is supported for the alert pin.
> 
> Datasheet: https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
> Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
> ---
> Changes in v2:
>    - Incorporate as6200 into lm75 driver
> 
>   Documentation/hwmon/lm75.rst |  10 +++
>   drivers/hwmon/lm75.c         | 132 +++++++++++++++++++++++++++++------
>   2 files changed, 122 insertions(+), 20 deletions(-)
> 
> diff --git a/Documentation/hwmon/lm75.rst b/Documentation/hwmon/lm75.rst
> index 8d0ab4ad5fb5..6adab608dd05 100644
> --- a/Documentation/hwmon/lm75.rst
> +++ b/Documentation/hwmon/lm75.rst
> @@ -133,6 +133,16 @@ Supported chips:
>   
>                  https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf
>   
> +  * AMS OSRAM AS6200
> +
> +    Prefix: 'as6200'
> +
> +    Addresses scanned: none
> +
> +    Datasheet: Publicly available at the AMS website
> +
> +               https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
> +
>   Author: Frodo Looijaard <frodol@dds.nl>
>   
>   Description
> diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
> index 5b2ea05c951e..2d153f6729e0 100644
> --- a/drivers/hwmon/lm75.c
> +++ b/drivers/hwmon/lm75.c
> @@ -7,6 +7,7 @@
>   
>   #include <linux/module.h>
>   #include <linux/init.h>
> +#include <linux/interrupt.h>
>   #include <linux/slab.h>
>   #include <linux/jiffies.h>
>   #include <linux/i2c.h>
> @@ -25,6 +26,7 @@
>   
>   enum lm75_type {		/* keep sorted in alphabetical order */
>   	adt75,
> +	as6200,
>   	at30ts74,
>   	ds1775,
>   	ds75,
> @@ -55,6 +57,7 @@ enum lm75_type {		/* keep sorted in alphabetical order */
>   
>   /**
>    * struct lm75_params - lm75 configuration parameters.
> + * @config_reg_16bits	Configure register size is 2 bytes.

@config_reg_16bits:

>    * @set_mask:		Bits to set in configuration register when configuring
>    *			the chip.
>    * @clr_mask:		Bits to clear in configuration register when configuring
> @@ -75,17 +78,20 @@ enum lm75_type {		/* keep sorted in alphabetical order */
>    * @sample_times:	All the possible sample times to be set. Mandatory if
>    *			num_sample_times is larger than 1. If set, number of
>    *			entries must match num_sample_times.
> + * @alarm		Alarm is supported.

@alarm:

>    */
>   
>   struct lm75_params {
> -	u8			set_mask;
> -	u8			clr_mask;
> +	bool			config_reg_16bits;
> +	u16			set_mask;
> +	u16			clr_mask;
>   	u8			default_resolution;
>   	u8			resolution_limits;
>   	const u8		*resolutions;
>   	unsigned int		default_sample_time;
>   	u8			num_sample_times;
>   	const unsigned int	*sample_times;
> +	bool			alarm;
>   };
>   
>   /* Addresses scanned */
> @@ -104,8 +110,8 @@ struct lm75_data {
>   	struct i2c_client		*client;
>   	struct regmap			*regmap;
>   	struct regulator		*vs;
> -	u8				orig_conf;
> -	u8				current_conf;
> +	u16				orig_conf;
> +	u16				current_conf;
>   	u8				resolution;	/* In bits, 9 to 16 */
>   	unsigned int			sample_time;	/* In ms */
>   	enum lm75_type			kind;
> @@ -128,6 +134,15 @@ static const struct lm75_params device_params[] = {
>   		.default_resolution = 12,
>   		.default_sample_time = MSEC_PER_SEC / 10,
>   	},
> +	[as6200] = {
> +		.config_reg_16bits = true,
> +		.set_mask = 0x94C0,	/* 8 sample/s, 4 CF, positive polarity */
> +		.default_resolution = 12,
> +		.default_sample_time = 125,
> +		.num_sample_times = 4,
> +		.sample_times = (unsigned int []){ 125, 250, 1000, 4000 },
> +		.alarm = true,
> +	},
>   	[at30ts74] = {
>   		.set_mask = 3 << 5,	/* 12-bit mode*/
>   		.default_resolution = 12,
> @@ -317,20 +332,23 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
>   	return ((temp >> (16 - resolution)) * 1000) >> (resolution - 8);
>   }
>   
> -static int lm75_write_config(struct lm75_data *data, u8 set_mask,
> -			     u8 clr_mask)
> +static int lm75_write_config(struct lm75_data *data, u16 set_mask,
> +			     u16 clr_mask)
>   {
> -	u8 value;
> +	unsigned int value;
>   
> -	clr_mask |= LM75_SHUTDOWN;
> +	clr_mask |= LM75_SHUTDOWN << (8 * data->params->config_reg_16bits);
>   	value = data->current_conf & ~clr_mask;
>   	value |= set_mask;
>   
>   	if (data->current_conf != value) {
>   		s32 err;
> -
> -		err = i2c_smbus_write_byte_data(data->client, LM75_REG_CONF,
> -						value);
> +		if (data->params->config_reg_16bits)
> +			err = regmap_write(data->regmap, LM75_REG_CONF, value);
> +		else
> +			err = i2c_smbus_write_byte_data(data->client,
> +							LM75_REG_CONF,
> +							value);
>   		if (err)
>   			return err;
>   		data->current_conf = value;
> @@ -338,6 +356,33 @@ static int lm75_write_config(struct lm75_data *data, u8 set_mask,
>   	return 0;
>   }
>   
> +static int lm75_read_config(struct lm75_data *data, u16 *config)
> +{
> +	int ret;
> +	unsigned int status;
> +
> +	if (data->params->config_reg_16bits) {
> +		ret = regmap_read(data->regmap, LM75_REG_CONF, &status);
> +	} else {
> +		ret = i2c_smbus_read_byte_data(data->client, LM75_REG_CONF);
> +		status = ret;
> +	}
> +
> +	if (ret < 0)
> +		return ret;
> +
> +	*config = status;
> +	return 0;
> +}
> +
> +static irqreturn_t lm75_alarm_handler(int irq, void *private)
> +{
> +	struct device *hwmon_dev = private;
> +
> +	hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_alarm, 0);
> +	return IRQ_HANDLED;
> +}
> +
>   static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
>   		     u32 attr, int channel, long *val)
>   {
> @@ -366,6 +411,9 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
>   		case hwmon_temp_max_hyst:
>   			reg = LM75_REG_HYST;
>   			break;
> +		case hwmon_temp_alarm:
> +			reg = LM75_REG_CONF;
> +			break;
>   		default:
>   			return -EINVAL;
>   		}
> @@ -373,7 +421,17 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
>   		if (err < 0)
>   			return err;
>   
> -		*val = lm75_reg_to_mc(regval, data->resolution);
> +		if (attr == hwmon_temp_alarm) {
> +			switch (data->kind) {
> +			case as6200:
> +				*val = (regval >> 5) & 0x1;
> +				break;
> +			default:
> +				return -EINVAL;
> +			}
> +		} else {
> +			*val = lm75_reg_to_mc(regval, data->resolution);
> +		}
>   		break;
>   	default:
>   		return -EINVAL;
> @@ -436,6 +494,7 @@ static int lm75_update_interval(struct device *dev, long val)
>   			data->resolution = data->params->resolutions[index];
>   		break;
>   	case tmp112:
> +	case as6200:
>   		err = regmap_read(data->regmap, LM75_REG_CONF, &reg);
>   		if (err < 0)
>   			return err;
> @@ -503,6 +562,9 @@ static umode_t lm75_is_visible(const void *data, enum hwmon_sensor_types type,
>   		case hwmon_temp_max:
>   		case hwmon_temp_max_hyst:
>   			return 0644;
> +		case hwmon_temp_alarm:
> +			if (config_data->params->alarm)
> +				return 0444;

Missing
			break;

>   		}
>   		break;
>   	default:
> @@ -515,7 +577,8 @@ static const struct hwmon_channel_info * const lm75_info[] = {
>   	HWMON_CHANNEL_INFO(chip,
>   			   HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
>   	HWMON_CHANNEL_INFO(temp,
> -			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
> +			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST |
> +			   HWMON_T_ALARM),
>   	NULL
>   };
>   
> @@ -574,7 +637,7 @@ static int lm75_probe(struct i2c_client *client)
>   	struct device *dev = &client->dev;
>   	struct device *hwmon_dev;
>   	struct lm75_data *data;
> -	int status, err;
> +	int err;
>   	enum lm75_type kind;
>   
>   	if (client->dev.of_node)
> @@ -623,13 +686,13 @@ static int lm75_probe(struct i2c_client *client)
>   		return err;
>   
>   	/* Cache original configuration */
> -	status = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
> -	if (status < 0) {
> -		dev_dbg(dev, "Can't read config? %d\n", status);
> -		return status;
> +	err = lm75_read_config(data, &data->current_conf);
> +	if (err) {
> +		dev_dbg(dev, "Can't read config? %d\n", err);
> +		return err;
>   	}

I don't think splitting the return value from the error code adds any value,
even more so since it needs to be dereferenced below anyway. Please just keep
the original semantics here, and have lm75_read_config() return the combined
error code and status.

> -	data->orig_conf = status;
> -	data->current_conf = status;
> +
> +	data->orig_conf = data->current_conf;
>   
>   	err = lm75_write_config(data, data->params->set_mask,
>   				data->params->clr_mask);
> @@ -646,6 +709,30 @@ static int lm75_probe(struct i2c_client *client)
>   	if (IS_ERR(hwmon_dev))
>   		return PTR_ERR(hwmon_dev);
>   
> +	if (client->irq) {
> +		if (data->params->alarm) {
> +			err = devm_request_threaded_irq(dev,
> +							client->irq,
> +							NULL,
> +							&lm75_alarm_handler,
> +							IRQF_ONESHOT,
> +							client->name,
> +							hwmon_dev);
> +			if (err)
> +				return err;
> +		} else {
> +			/*
> +			 * Currently, alarm is only supported for chips with
> +			 * alarm bit.
> +			 * In the future, if alarm is needed for chips with
> +			 * no alarm bit, current temp needs to be compared
> +			 * against the max and max hyst values to set/clear
> +			 * the alarm state.

Please don't make such suggestions. If userspace wants to compare attributes
if there is no alarm attribute, it is free to do it. We should not even try
to do it in the kernel.

> +			 */
> +			dev_warn(dev, "alarm interrupt is not supported\n");

I think this should be an error: There should be no interrupt configured on a
chip not supporting it.

> +		}
> +	}
> +
>   	dev_info(dev, "%s: sensor '%s'\n", dev_name(hwmon_dev), client->name);
>   
>   	return 0;
> @@ -654,6 +741,7 @@ static int lm75_probe(struct i2c_client *client)
>   static const struct i2c_device_id lm75_ids[] = {
>   	{ "adt75", adt75, },
>   	{ "at30ts74", at30ts74, },
> +	{ "as6200", as6200, },

Alphabetic order, please

>   	{ "ds1775", ds1775, },
>   	{ "ds75", ds75, },
>   	{ "ds7505", ds7505, },
> @@ -689,6 +777,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = {
>   		.compatible = "adi,adt75",
>   		.data = (void *)adt75
>   	},
> +	{
> +		.compatible = "ams,as6200",
> +		.data = (void *)as6200
> +	},
>   	{
>   		.compatible = "atmel,at30ts74",
>   		.data = (void *)at30ts74


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-18  4:52 [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor Abdel Alkuor
  2023-12-18  4:52 ` [PATCH v2 2/2] " Abdel Alkuor
@ 2023-12-19 15:18 ` Conor Dooley
  2023-12-19 16:27   ` Abdel Alkuor
  1 sibling, 1 reply; 10+ messages in thread
From: Conor Dooley @ 2023-12-19 15:18 UTC (permalink / raw)
  To: Abdel Alkuor
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet, linux-hwmon, devicetree,
	linux-kernel, linux-doc

[-- Attachment #1: Type: text/plain, Size: 2822 bytes --]

On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote:
> as6200 is a temperature sensor with a range between -40°C to
> 125°C degrees and an accuracy of ±0.4°C degree between 0
> and 65°C and ±1°C for the other ranges.
> 
> Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
> ---
> Changes in v2:
>   - Incorporate as6200 into lm75 bindings
> 
>  .../devicetree/bindings/hwmon/lm75.yaml        | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> index 0b69897f0c63..63b85a83ac18 100644
> --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> @@ -14,6 +14,7 @@ properties:
>    compatible:
>      enum:
>        - adi,adt75
> +      - ams,as6200
>        - atmel,at30ts74
>        - dallas,ds1775
>        - dallas,ds75
> @@ -48,6 +49,9 @@ properties:
>    vs-supply:
>      description: phandle to the regulator that provides the +VS supply
>  
> +  interrupts:
> +    maxItems: 1

Do the other devices here have interrupts? If not, you just allowed
interrupts for them. You, at the very least, need to add something like:

diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
index 63b85a83ac18..d7ce96606400 100644
--- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
+++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
@@ -56,6 +56,17 @@ required:
   - compatible
   - reg
 
+allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              const: ams,as6200
+    then:
+      properties:
+        interrupts: false
+
 additionalProperties: false
 
 examples:

I had a brief look at the driver though, but I could not immediately
tell if the interrupt was required on the ams,as6200 or if the driver
continued on without that functionality. It seemed like an additional
feature that the interrupt was required for, but if not you should make
the interrupt required for the as6200.

> +
>  required:
>    - compatible
>    - reg
> @@ -66,3 +70,17 @@ examples:
>          vs-supply = <&vs>;
>        };
>      };
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        temperature-sensor@48 {
> +            compatible = "ams,as6200";
> +            reg = <0x48>;
> +            vs-supply = <&vs>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <17 IRQ_TYPE_EDGE_BOTH>;
> +        };
> +    };

Can you make the indent here match that in the other example in this
file please?

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-19 15:18 ` [PATCH v2 1/2] dt-bindings: " Conor Dooley
@ 2023-12-19 16:27   ` Abdel Alkuor
  2023-12-20 16:25     ` Conor Dooley
  0 siblings, 1 reply; 10+ messages in thread
From: Abdel Alkuor @ 2023-12-19 16:27 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet, linux-hwmon, devicetree,
	linux-kernel, linux-doc

On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote:
> On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote:
> 
> Do the other devices here have interrupts? If not, you just allowed
> interrupts for them. You, at the very least, need to add something like:
> diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> index 63b85a83ac18..d7ce96606400 100644
> --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> @@ -56,6 +56,17 @@ required:
>    - compatible
>    - reg
>  
> +allOf:
> +  - if:
> +      not:
> +        properties:
> +          compatible:
> +            contains:
> +              const: ams,as6200
> +    then:
> +      properties:
> +        interrupts: false
> +
>  additionalProperties: false
>  
No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200.
For now, I'll add the check for ams,as6200.
>  examples:
> 
> I had a brief look at the driver though, but I could not immediately
> tell if the interrupt was required on the ams,as6200 or if the driver
> continued on without that functionality. It seemed like an additional
> feature that the interrupt was required for, but if not you should make
> the interrupt required for the as6200.
> 
It is an additional feature. The interrupt basically notifies the user space when the
alarm state changes through temp1_alarm sysfs using poll on the file for example. That
being said, we should still be able to read the alarm state for as6200 without the
interrupt present.
> > +
> >  required:
> >    - compatible
> >    - reg
> > @@ -66,3 +70,17 @@ examples:
> >          vs-supply = <&vs>;
> >        };
> >      };
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        temperature-sensor@48 {
> > +            compatible = "ams,as6200";
> > +            reg = <0x48>;
> > +            vs-supply = <&vs>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <17 IRQ_TYPE_EDGE_BOTH>;
> > +        };
> > +    };
> 
> Can you make the indent here match that in the other example in this
> file please?
Sure. 

Thanks,
Abdel



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-19 16:27   ` Abdel Alkuor
@ 2023-12-20 16:25     ` Conor Dooley
  2023-12-20 17:05       ` Abdel Alkuor
  0 siblings, 1 reply; 10+ messages in thread
From: Conor Dooley @ 2023-12-20 16:25 UTC (permalink / raw)
  To: Abdel Alkuor
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet, linux-hwmon, devicetree,
	linux-kernel, linux-doc

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote:
> On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote:
> > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote:
> > 
> > Do the other devices here have interrupts? If not, you just allowed
> > interrupts for them. You, at the very least, need to add something like:
> > diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> > index 63b85a83ac18..d7ce96606400 100644
> > --- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
> > +++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
> > @@ -56,6 +56,17 @@ required:
> >    - compatible
> >    - reg
> >  
> > +allOf:
> > +  - if:
> > +      not:
> > +        properties:
> > +          compatible:
> > +            contains:
> > +              const: ams,as6200
> > +    then:
> > +      properties:
> > +        interrupts: false
> > +
> >  additionalProperties: false
> >  
> No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200.
> For now, I'll add the check for ams,as6200.

If multiple devices have the interrupt you should document it for all of
them IMO.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-20 16:25     ` Conor Dooley
@ 2023-12-20 17:05       ` Abdel Alkuor
  2023-12-20 17:16         ` Conor Dooley
  0 siblings, 1 reply; 10+ messages in thread
From: Abdel Alkuor @ 2023-12-20 17:05 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet, linux-hwmon, devicetree,
	linux-kernel, linux-doc

On Wed, Dec 20, 2023 at 04:25:15PM +0000, Conor Dooley wrote:
> On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote:
> > On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote:
> > > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote:
> > >  
> > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200.
> > For now, I'll add the check for ams,as6200.
>
Hi Conor,
> If multiple devices have the interrupt you should document it for all of
> them IMO.

The interrupt hasn't been implemented for tmp101, tmp102 and tmp112 yet.
Should I still add them to the interrupt property? They might be two different
things driver and bindings, but I just wanted to make sure.

Thanks,
Abdel



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-20 17:05       ` Abdel Alkuor
@ 2023-12-20 17:16         ` Conor Dooley
  2023-12-20 17:28           ` Abdel Alkuor
  0 siblings, 1 reply; 10+ messages in thread
From: Conor Dooley @ 2023-12-20 17:16 UTC (permalink / raw)
  To: Abdel Alkuor
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet, linux-hwmon, devicetree,
	linux-kernel, linux-doc

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

On Wed, Dec 20, 2023 at 12:05:17PM -0500, Abdel Alkuor wrote:
> On Wed, Dec 20, 2023 at 04:25:15PM +0000, Conor Dooley wrote:
> > On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote:
> > > On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote:
> > > > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote:
> > > >  
> > > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200.
> > > For now, I'll add the check for ams,as6200.
> >
> Hi Conor,
> > If multiple devices have the interrupt you should document it for all of
> > them IMO.
> 
> The interrupt hasn't been implemented for tmp101, tmp102 and tmp112 yet.
> Should I still add them to the interrupt property? They might be two different
> things driver and bindings, but I just wanted to make sure.

I don't really care if the driver supports the interrupt on any of the
platforms (including the as6200), if the hardware has an interrupt the
binding should reflect that :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  2023-12-20 17:16         ` Conor Dooley
@ 2023-12-20 17:28           ` Abdel Alkuor
  0 siblings, 0 replies; 10+ messages in thread
From: Abdel Alkuor @ 2023-12-20 17:28 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Corbet, linux-hwmon, devicetree,
	linux-kernel, linux-doc

On Wed, Dec 20, 2023 at 05:16:08PM +0000, Conor Dooley wrote:
> On Wed, Dec 20, 2023 at 12:05:17PM -0500, Abdel Alkuor wrote:
> > On Wed, Dec 20, 2023 at 04:25:15PM +0000, Conor Dooley wrote:
> > > On Tue, Dec 19, 2023 at 11:27:29AM -0500, Abdel Alkuor wrote:
> > > > On Tue, Dec 19, 2023 at 03:18:24PM +0000, Conor Dooley wrote:
> > > > > On Sun, Dec 17, 2023 at 11:52:27PM -0500, Abdel Alkuor wrote:
> > > > >  
> > > > No, not all of them support the interrupt. Just tmp101, tmp102, tmp112, and as6200.
> > > > For now, I'll add the check for ams,as6200.
> > >
> > Hi Conor,
> > > If multiple devices have the interrupt you should document it for all of
> > > them IMO.
> > 
> > The interrupt hasn't been implemented for tmp101, tmp102 and tmp112 yet.
> > Should I still add them to the interrupt property? They might be two different
> > things driver and bindings, but I just wanted to make sure.
> 
> I don't really care if the driver supports the interrupt on any of the
> platforms (including the as6200), if the hardware has an interrupt the
> binding should reflect that :)

Understood. I'll add them in v4.

Abdel



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-20 17:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18  4:52 [PATCH v2 1/2] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor Abdel Alkuor
2023-12-18  4:52 ` [PATCH v2 2/2] " Abdel Alkuor
2023-12-18 17:00   ` kernel test robot
2023-12-18 17:37   ` Guenter Roeck
2023-12-19 15:18 ` [PATCH v2 1/2] dt-bindings: " Conor Dooley
2023-12-19 16:27   ` Abdel Alkuor
2023-12-20 16:25     ` Conor Dooley
2023-12-20 17:05       ` Abdel Alkuor
2023-12-20 17:16         ` Conor Dooley
2023-12-20 17:28           ` Abdel Alkuor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).