Message ID | 20240221175810.3581399-1-m.felsch@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-75241-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1199613dyc; Wed, 21 Feb 2024 09:58:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVpUIfZt0rCizJ/6Xb1zmGf2caq9zyRlMktasoT5eB5UZ1Uf7kQKQzBTkJo3dvtFDC23sKlX24OB8a4D0M5+U/bzLjIzQ== X-Google-Smtp-Source: AGHT+IFKk+yOZUIauaA5NsUogQpVPjayu/ufiXKyLP+uhqWvr0Ev/Hvheq2UozgUpU9ygDyxBpSQ X-Received: by 2002:a05:620a:1124:b0:787:7ee6:1309 with SMTP id p4-20020a05620a112400b007877ee61309mr4282509qkk.41.1708538324953; Wed, 21 Feb 2024 09:58:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708538324; cv=pass; d=google.com; s=arc-20160816; b=QbIg2qKduUzYoW4OGDxEr70d4UD9fe/97jRuYfRHkXV2yV/s66VfQTpB0DRKJ+tK/U rZdChpBrXjnNsTnlOa44AJugp+T3GqTKOBOEzfR3dwYtOZWq2t1DcLBBOuxfVgBw+s3F cxsQQKJo7AztWyw4kCS78XWKcJ9KRjrlfR4+fYFJFZbBxnSe9uLGwbla39FZDL6e0NfS +PfMOtiz0UAybufiLPlpcM/zVArON43ELidXoAlhGSXIKcQMTKP38tccIWWwsKRCHeLJ EEKRXBwYB7/5Rlw6mxocDWz2lNonr6ZTTrMeJrTSIFf1DinobcmAwjlIaqIPQYkct/J6 KGWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=OV1z1cj8Nd4fVwyRMgnGI1NH7NKFD7r4n1BUtQ8lBlM=; fh=jjI2FaRobHs0S4kUZBBcCES7JiD0/+wk0UWwSabqX/o=; b=oU9mJGaFycfST7gX9RmlpKa1J9eyyHNxBhMyLzHxPUTH39lTmUzRnUWMpXQdWCMNI1 Skio6+8iNVpIatoNL2bhIpFSQCVZIdbJ0J4yZkF/YzjRZYGr0RPf9L3kVBvspf7yzMI1 teV+gUxkEE8JtCeeKX919v/V1b+5sx+Svw71zk48djPmHb1F6kv4lC423nnVn9/5KKb4 41bd+WquCSFQ29MDQEOOY9M8ThkbfPS/whs31ZN5AIyrl9REVihYpeUN6yOyY2eBytvF hP4kY+PEww9ybnVjMmpWMUYyRnmhdgR7FMArVjFKg6e/WbnqEegyuFRN+95Rnj8h3yDm cQ6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-75241-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75241-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y5-20020a05620a0e0500b00787400a8ce8si11473304qkm.693.2024.02.21.09.58.44 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:58:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75241-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-75241-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75241-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B9F0D1C241A2 for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 17:58:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F45E83CB2; Wed, 21 Feb 2024 17:58:29 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 803E785264 for <linux-kernel@vger.kernel.org>; Wed, 21 Feb 2024 17:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708538307; cv=none; b=htBqWHXyjcWXkbNH/jmNicM3ZFrvUp6ARalYp5gtgqQId33KIs5rNzqjGJc7EJDnPuxTQnNOBnQTURzYjwW3z0g4TSyn/itIF1/8tSxXGXMcWIR4f77XMQ2as416u+V0HpNfApBtVjPrTNsmYHTvJJ4r1AGs+5xQgBeizCsaiaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708538307; c=relaxed/simple; bh=SDXjqB4wIG3XnhyFFBnM6Pd3RHudSe6ZGddZfgcxJrQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=oGOozsIMsknVWZ72ygVXvoga2owAVHqVqikV4UNMmX6xahfbuqQWGdUIkd/dM79aY92OANVp5NkyWP9CgAE65dCjS5q1VNZHQEOanDUkC8XDU16l5UIXPEt0+T62BQb/tZ5RUaaDebRjDBubIZpt9RjBxhDhZHoXxmzeJ7F4kIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from <m.felsch@pengutronix.de>) id 1rcqrF-00046q-LD; Wed, 21 Feb 2024 18:58:13 +0100 From: Marco Felsch <m.felsch@pengutronix.de> To: jic23@kernel.org, lars@metafoo.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, denis.ciocca@st.com, linus.walleij@linaro.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH] dt-bindings: iio: st-sensors: Add IIS2MDC magnetometer Date: Wed, 21 Feb 2024 18:58:10 +0100 Message-Id: <20240221175810.3581399-1-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791532282585948691 X-GMAIL-MSGID: 1791532282585948691 |
Series |
dt-bindings: iio: st-sensors: Add IIS2MDC magnetometer
|
|
Commit Message
Marco Felsch
Feb. 21, 2024, 5:58 p.m. UTC
Add the iis2mdc magnetometer support which is equivalent to the lis2mdl.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
1 file changed, 1 insertion(+)
Comments
On Wed, Feb 21, 2024 at 06:58:10PM +0100, Marco Felsch wrote: > Add the iis2mdc magnetometer support which is equivalent to the lis2mdl. > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > --- > Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > index fff7e3d83a02..ee593c8bbb65 100644 > --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > @@ -64,6 +64,7 @@ properties: > - st,lsm9ds0-gyro > - description: STMicroelectronics Magnetometers > enum: > + - st,iis2mdc Without a fallback compatible to the equivilent device, how does a driver bind to this device? Cheers, Conor. > - st,lis2mdl > - st,lis3mdl-magn > - st,lsm303agr-magn > -- > 2.39.2 >
On 24-02-21, Conor Dooley wrote: > On Wed, Feb 21, 2024 at 06:58:10PM +0100, Marco Felsch wrote: > > Add the iis2mdc magnetometer support which is equivalent to the lis2mdl. > > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > > --- > > Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > index fff7e3d83a02..ee593c8bbb65 100644 > > --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > @@ -64,6 +64,7 @@ properties: > > - st,lsm9ds0-gyro > > - description: STMicroelectronics Magnetometers > > enum: > > + - st,iis2mdc > > Without a fallback compatible to the equivilent device, how does a > driver bind to this device? I skimed the datasheets and the driver already handles this binding exactly the same as the st,lis2mdl, so my assumption is they do match. Why do I you think we need a fallback compatible here? Regards, Marco > > Cheers, > Conor. > > > - st,lis2mdl > > - st,lis3mdl-magn > > - st,lsm303agr-magn > > -- > > 2.39.2 > >
On Wed, Feb 21, 2024 at 08:16:44PM +0100, Marco Felsch wrote: > On 24-02-21, Conor Dooley wrote: > > On Wed, Feb 21, 2024 at 06:58:10PM +0100, Marco Felsch wrote: > > > Add the iis2mdc magnetometer support which is equivalent to the lis2mdl. > > > > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > > > --- > > > Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > index fff7e3d83a02..ee593c8bbb65 100644 > > > --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > @@ -64,6 +64,7 @@ properties: > > > - st,lsm9ds0-gyro > > > - description: STMicroelectronics Magnetometers > > > enum: > > > + - st,iis2mdc > > > > Without a fallback compatible to the equivilent device, how does a > > driver bind to this device? > > I skimed the datasheets and the driver already handles this binding > exactly the same as the st,lis2mdl, so my assumption is they do match. > > Why do I you think we need a fallback compatible here? I didn't look at the driver, there was no mention of the driver already having (undocumented) support for it. Since there was no driver change alongside this patch, I thought you'd need a fallback compatible to allow the driver to match against a compatible it recognises. Besides, having fallback compatibles is the norm when one device has the same programming model as another. Cheers, Conor.
Hi Conor, On 24-02-21, Conor Dooley wrote: > On Wed, Feb 21, 2024 at 08:16:44PM +0100, Marco Felsch wrote: > > On 24-02-21, Conor Dooley wrote: > > > On Wed, Feb 21, 2024 at 06:58:10PM +0100, Marco Felsch wrote: > > > > Add the iis2mdc magnetometer support which is equivalent to the lis2mdl. > > > > > > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > > > > --- > > > > Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > index fff7e3d83a02..ee593c8bbb65 100644 > > > > --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > @@ -64,6 +64,7 @@ properties: > > > > - st,lsm9ds0-gyro > > > > - description: STMicroelectronics Magnetometers > > > > enum: > > > > + - st,iis2mdc > > > > > > Without a fallback compatible to the equivilent device, how does a > > > driver bind to this device? > > > > I skimed the datasheets and the driver already handles this binding > > exactly the same as the st,lis2mdl, so my assumption is they do match. > > > > Why do I you think we need a fallback compatible here? > > I didn't look at the driver, there was no mention of the driver already > having (undocumented) support for it. Since there was no driver change > alongside this patch, I thought you'd need a fallback compatible to > allow the driver to match against a compatible it recognises. I explicitly did not mention the driver in the commit message else I would have got a response like "dt-bindings have no dependency to drivers" ;) > Besides, having fallback compatibles is the norm when one device has the > same programming model as another. Not for this binding according the driver. Regards, Marco > > > Cheers, > Conor. >
On Wed, Feb 21, 2024 at 08:45:18PM +0100, Marco Felsch wrote: > Hi Conor, > > On 24-02-21, Conor Dooley wrote: > > On Wed, Feb 21, 2024 at 08:16:44PM +0100, Marco Felsch wrote: > > > On 24-02-21, Conor Dooley wrote: > > > > On Wed, Feb 21, 2024 at 06:58:10PM +0100, Marco Felsch wrote: > > > > > Add the iis2mdc magnetometer support which is equivalent to the lis2mdl. > > > > > > > > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > > > > > --- > > > > > Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > > index fff7e3d83a02..ee593c8bbb65 100644 > > > > > --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > > +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > > @@ -64,6 +64,7 @@ properties: > > > > > - st,lsm9ds0-gyro > > > > > - description: STMicroelectronics Magnetometers > > > > > enum: > > > > > + - st,iis2mdc > > > > > > > > Without a fallback compatible to the equivilent device, how does a > > > > driver bind to this device? > > > > > > I skimed the datasheets and the driver already handles this binding > > > exactly the same as the st,lis2mdl, so my assumption is they do match. > > > > > > Why do I you think we need a fallback compatible here? > > > > I didn't look at the driver, there was no mention of the driver already > > having (undocumented) support for it. Since there was no driver change > > alongside this patch, I thought you'd need a fallback compatible to > > allow the driver to match against a compatible it recognises. > > I explicitly did not mention the driver in the commit message else I > would have got a response like "dt-bindings have no dependency to > drivers" ;) Putting it under the --- line is always an option. Where there are existing users but the compatible is just undocumented, this it's helpful to do. > > Besides, having fallback compatibles is the norm when one device has the > > same programming model as another. > > Not for this binding according the driver. If they don't have the same programming model, then describing them as "equivalent" wouldn't be correct. That said, they seem to use the same sensor settings when alls said and done (see st_magn_sensors_settings), so I think they are actually compatible even if the driver has separate match data for each. Cheers, Conor.
On 24-02-21, Conor Dooley wrote: > On Wed, Feb 21, 2024 at 08:45:18PM +0100, Marco Felsch wrote: > > Hi Conor, > > > > On 24-02-21, Conor Dooley wrote: > > > On Wed, Feb 21, 2024 at 08:16:44PM +0100, Marco Felsch wrote: > > > > On 24-02-21, Conor Dooley wrote: > > > > > On Wed, Feb 21, 2024 at 06:58:10PM +0100, Marco Felsch wrote: > > > > > > Add the iis2mdc magnetometer support which is equivalent to the lis2mdl. > > > > > > > > > > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > > > > > > --- > > > > > > Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + > > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > > > index fff7e3d83a02..ee593c8bbb65 100644 > > > > > > --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > > > +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml > > > > > > @@ -64,6 +64,7 @@ properties: > > > > > > - st,lsm9ds0-gyro > > > > > > - description: STMicroelectronics Magnetometers > > > > > > enum: > > > > > > + - st,iis2mdc > > > > > > > > > > Without a fallback compatible to the equivilent device, how does a > > > > > driver bind to this device? > > > > > > > > I skimed the datasheets and the driver already handles this binding > > > > exactly the same as the st,lis2mdl, so my assumption is they do match. > > > > > > > > Why do I you think we need a fallback compatible here? > > > > > > I didn't look at the driver, there was no mention of the driver already > > > having (undocumented) support for it. Since there was no driver change > > > alongside this patch, I thought you'd need a fallback compatible to > > > allow the driver to match against a compatible it recognises. > > > > I explicitly did not mention the driver in the commit message else I > > would have got a response like "dt-bindings have no dependency to > > drivers" ;) > > Putting it under the --- line is always an option. Where there are > existing users but the compatible is just undocumented, this it's > helpful to do. > > > > Besides, having fallback compatibles is the norm when one device has the > > > same programming model as another. > > > > Not for this binding according the driver. > > If they don't have the same programming model, then describing them as > "equivalent" wouldn't be correct. That said, they seem to use the same > sensor settings when alls said and done (see st_magn_sensors_settings), > so I think they are actually compatible even if the driver has separate > match data for each. I told you that I have checked the driver and skimed the datasheets and came to the exact same conclusion. Regards, Marco > > Cheers, > Conor.
On Thu, Feb 22, 2024 at 09:47:17AM +0100, Marco Felsch wrote: > On 24-02-21, Conor Dooley wrote: > > On Wed, Feb 21, 2024 at 08:45:18PM +0100, Marco Felsch wrote: > > > On 24-02-21, Conor Dooley wrote: > > > > On Wed, Feb 21, 2024 at 08:16:44PM +0100, Marco Felsch wrote: > > > > > On 24-02-21, Conor Dooley wrote: > > > > > > On Wed, Feb 21, 2024 at 06:58:10PM +0100, Marco Felsch wrote: > > > > Besides, having fallback compatibles is the norm when one device has the > > > > same programming model as another. > > > > > > Not for this binding according the driver. > > > > If they don't have the same programming model, then describing them as > > "equivalent" wouldn't be correct. That said, they seem to use the same > > sensor settings when alls said and done (see st_magn_sensors_settings), > > so I think they are actually compatible even if the driver has separate > > match data for each. > > I told you that I have checked the driver and skimed the datasheets and > came to the exact same conclusion. Did you tell me that? I did't see it. Anyway, I think what happened is that I interpreted "Not for this binding according the driver" as a comment about the programming model being different, but you meant it in reference to the fallback. Since they do have the same programming model the fallback is appropriate, even if the driver knows about the iis2mdc compatible. I'd squash in the following, similar to what was done for the st,iis328dq that was added recently: diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml index ee593c8bbb65..ee6c3800436d 100644 --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml @@ -64,7 +64,6 @@ properties: - st,lsm9ds0-gyro - description: STMicroelectronics Magnetometers enum: - - st,iis2mdc - st,lis2mdl - st,lis3mdl-magn - st,lsm303agr-magn @@ -73,6 +72,9 @@ properties: - st,lsm303dlhc-magn - st,lsm303dlm-magn - st,lsm9ds1-magn + - items: + - const: st,iis2mdc + - const: st,lis2mdl - description: STMicroelectronics Pressure Sensors enum: - st,lps001wp-press
diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml index fff7e3d83a02..ee593c8bbb65 100644 --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml @@ -64,6 +64,7 @@ properties: - st,lsm9ds0-gyro - description: STMicroelectronics Magnetometers enum: + - st,iis2mdc - st,lis2mdl - st,lis3mdl-magn - st,lsm303agr-magn