* [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support @ 2022-02-02 23:50 Samuel Holland 2022-02-02 23:50 ` [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix Samuel Holland ` (4 more replies) 0 siblings, 5 replies; 11+ messages in thread From: Samuel Holland @ 2022-02-02 23:50 UTC (permalink / raw) To: Jonathan Cameron, Lars-Peter Clausen, Denis Ciocca, Linus Walleij, Rob Herring, devicetree Cc: linux-iio, linux-kernel, Samuel Holland This chip is register-compatible with an ST part, so it works without any issues when added to the existing driver. Previously I called it a clone, but it's not really a clone, because it's not a drop-in replacement for the other chips. The software interface matches the ST parts, but the pinout does not. Instead, the pinout matches the Kionix KX122 and KX132. Changes in v2: - Move the new compatible to its own section - Add a comment about the WAI value - Update commit messages Samuel Holland (3): dt-bindings: vendor-prefixes: Add silan vendor prefix dt-bindings: iio: st: Add Silan SC7A20 accelerometer iio: accel: st_accel: Add support for Silan SC7A20 .../bindings/iio/st,st-sensors.yaml | 3 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + drivers/iio/accel/st_accel.h | 2 + drivers/iio/accel/st_accel_core.c | 83 +++++++++++++++++++ drivers/iio/accel/st_accel_i2c.c | 5 ++ 5 files changed, 95 insertions(+) -- 2.33.1 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix 2022-02-02 23:50 [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Samuel Holland @ 2022-02-02 23:50 ` Samuel Holland 2022-02-03 16:35 ` Linus Walleij 2022-02-09 21:59 ` Rob Herring 2022-02-02 23:50 ` [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer Samuel Holland ` (3 subsequent siblings) 4 siblings, 2 replies; 11+ messages in thread From: Samuel Holland @ 2022-02-02 23:50 UTC (permalink / raw) To: Jonathan Cameron, Lars-Peter Clausen, Denis Ciocca, Linus Walleij, Rob Herring, devicetree Cc: linux-iio, linux-kernel, Samuel Holland Hangzhou Silan Microelectronics Co., Ltd. (http://www.silan.com.cn/) is a manufacturer of ICs, including MEMS sensors. Signed-off-by: Samuel Holland <samuel@sholland.org> --- (no changes since v1) Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 294093d45a23..b923be2c8172 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1082,6 +1082,8 @@ patternProperties: description: Silicon Image "^silabs,.*": description: Silicon Laboratories + "^silan,.*": + description: Hangzhou Silan Microelectronics Co., Ltd. "^silead,.*": description: Silead Inc. "^silergy,.*": -- 2.33.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix 2022-02-02 23:50 ` [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix Samuel Holland @ 2022-02-03 16:35 ` Linus Walleij 2022-02-09 21:59 ` Rob Herring 1 sibling, 0 replies; 11+ messages in thread From: Linus Walleij @ 2022-02-03 16:35 UTC (permalink / raw) To: Samuel Holland Cc: Jonathan Cameron, Lars-Peter Clausen, Denis Ciocca, Rob Herring, devicetree, linux-iio, linux-kernel On Thu, Feb 3, 2022 at 12:50 AM Samuel Holland <samuel@sholland.org> wrote: > Hangzhou Silan Microelectronics Co., Ltd. (http://www.silan.com.cn/) is > a manufacturer of ICs, including MEMS sensors. > > Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix 2022-02-02 23:50 ` [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix Samuel Holland 2022-02-03 16:35 ` Linus Walleij @ 2022-02-09 21:59 ` Rob Herring 1 sibling, 0 replies; 11+ messages in thread From: Rob Herring @ 2022-02-09 21:59 UTC (permalink / raw) To: Samuel Holland Cc: Jonathan Cameron, linux-iio, devicetree, Denis Ciocca, Lars-Peter Clausen, linux-kernel, Linus Walleij, Rob Herring On Wed, 02 Feb 2022 17:50:46 -0600, Samuel Holland wrote: > Hangzhou Silan Microelectronics Co., Ltd. (http://www.silan.com.cn/) is > a manufacturer of ICs, including MEMS sensors. > > Signed-off-by: Samuel Holland <samuel@sholland.org> > --- > > (no changes since v1) > > Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ > 1 file changed, 2 insertions(+) > Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer 2022-02-02 23:50 [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Samuel Holland 2022-02-02 23:50 ` [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix Samuel Holland @ 2022-02-02 23:50 ` Samuel Holland 2022-02-03 16:35 ` Linus Walleij 2022-02-09 21:59 ` Rob Herring 2022-02-02 23:50 ` [PATCH v2 3/3] iio: accel: st_accel: Add support for Silan SC7A20 Samuel Holland ` (2 subsequent siblings) 4 siblings, 2 replies; 11+ messages in thread From: Samuel Holland @ 2022-02-02 23:50 UTC (permalink / raw) To: Jonathan Cameron, Lars-Peter Clausen, Denis Ciocca, Linus Walleij, Rob Herring, devicetree Cc: linux-iio, linux-kernel, Samuel Holland This chip is not an ST part, but it appears to be register-compatible with the LIS2DH, so it can use the same binding. Signed-off-by: Samuel Holland <samuel@sholland.org> --- Changes in v2: - Move the new compatible to its own section Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml index 71de5631ebae..9735a2048255 100644 --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml @@ -46,6 +46,9 @@ properties: - st,lsm330d-accel - st,lsm330dl-accel - st,lsm330dlc-accel + - description: Silan Accelerometers + enum: + - silan,sc7a20 - description: STMicroelectronics Gyroscopes enum: - st,l3g4200d-gyro -- 2.33.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer 2022-02-02 23:50 ` [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer Samuel Holland @ 2022-02-03 16:35 ` Linus Walleij 2022-02-09 21:59 ` Rob Herring 1 sibling, 0 replies; 11+ messages in thread From: Linus Walleij @ 2022-02-03 16:35 UTC (permalink / raw) To: Samuel Holland Cc: Jonathan Cameron, Lars-Peter Clausen, Denis Ciocca, Rob Herring, devicetree, linux-iio, linux-kernel On Thu, Feb 3, 2022 at 12:50 AM Samuel Holland <samuel@sholland.org> wrote: > This chip is not an ST part, but it appears to be register-compatible > with the LIS2DH, so it can use the same binding. > > Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer 2022-02-02 23:50 ` [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer Samuel Holland 2022-02-03 16:35 ` Linus Walleij @ 2022-02-09 21:59 ` Rob Herring 1 sibling, 0 replies; 11+ messages in thread From: Rob Herring @ 2022-02-09 21:59 UTC (permalink / raw) To: Samuel Holland Cc: linux-kernel, devicetree, Rob Herring, Denis Ciocca, Lars-Peter Clausen, linux-iio, Jonathan Cameron, Linus Walleij On Wed, 02 Feb 2022 17:50:47 -0600, Samuel Holland wrote: > This chip is not an ST part, but it appears to be register-compatible > with the LIS2DH, so it can use the same binding. > > Signed-off-by: Samuel Holland <samuel@sholland.org> > --- > > Changes in v2: > - Move the new compatible to its own section > > Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 3 +++ > 1 file changed, 3 insertions(+) > Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 3/3] iio: accel: st_accel: Add support for Silan SC7A20 2022-02-02 23:50 [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Samuel Holland 2022-02-02 23:50 ` [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix Samuel Holland 2022-02-02 23:50 ` [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer Samuel Holland @ 2022-02-02 23:50 ` Samuel Holland 2022-02-03 16:36 ` Linus Walleij 2022-02-05 17:25 ` [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Jonathan Cameron 2022-02-13 18:24 ` Jonathan Cameron 4 siblings, 1 reply; 11+ messages in thread From: Samuel Holland @ 2022-02-02 23:50 UTC (permalink / raw) To: Jonathan Cameron, Lars-Peter Clausen, Denis Ciocca, Linus Walleij, Rob Herring, devicetree Cc: linux-iio, linux-kernel, Samuel Holland This chip appears to be register-compatible with the LIS2DH. The new description is a copy of the LIS2DH's description with a different WAI value. Datasheet: http://linux-chenxing.org/silan/SC7A20-SilanMicroelectronics.pdf Datasheet: http://www.siitek.com.cn/Upfiles/down/SC7A20说明书_0.92(智能穿戴).pdf Signed-off-by: Samuel Holland <samuel@sholland.org> --- Changes in v2: - Add a comment about the WAI value - Update commit messages drivers/iio/accel/st_accel.h | 2 + drivers/iio/accel/st_accel_core.c | 83 +++++++++++++++++++++++++++++++ drivers/iio/accel/st_accel_i2c.c | 5 ++ 3 files changed, 90 insertions(+) diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h index 8750dea56fcb..00e056c21bfc 100644 --- a/drivers/iio/accel/st_accel.h +++ b/drivers/iio/accel/st_accel.h @@ -36,6 +36,7 @@ enum st_accel_type { LIS3DHH, LIS2DE12, LIS2HH12, + SC7A20, ST_ACCEL_MAX, }; @@ -61,6 +62,7 @@ enum st_accel_type { #define LIS3DE_ACCEL_DEV_NAME "lis3de" #define LIS2DE12_ACCEL_DEV_NAME "lis2de12" #define LIS2HH12_ACCEL_DEV_NAME "lis2hh12" +#define SC7A20_ACCEL_DEV_NAME "sc7a20" #ifdef CONFIG_IIO_BUFFER int st_accel_allocate_ring(struct iio_dev *indio_dev); diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 31ea19d0ba71..2ada8d6fb503 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -1087,6 +1087,89 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { .multi_read_bit = true, .bootime = 2, }, + { + /* + * Not an ST part. Register-compatible with the LIS2DH, even + * though the WAI value is different. + */ + .wai = 0x11, + .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, + .sensors_supported = { + [0] = SC7A20_ACCEL_DEV_NAME, + }, + .ch = (struct iio_chan_spec *)st_accel_12bit_channels, + .odr = { + .addr = 0x20, + .mask = 0xf0, + .odr_avl = { + { .hz = 1, .value = 0x01, }, + { .hz = 10, .value = 0x02, }, + { .hz = 25, .value = 0x03, }, + { .hz = 50, .value = 0x04, }, + { .hz = 100, .value = 0x05, }, + { .hz = 200, .value = 0x06, }, + { .hz = 400, .value = 0x07, }, + { .hz = 1600, .value = 0x08, }, + }, + }, + .pw = { + .addr = 0x20, + .mask = 0xf0, + .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE, + }, + .enable_axis = { + .addr = ST_SENSORS_DEFAULT_AXIS_ADDR, + .mask = ST_SENSORS_DEFAULT_AXIS_MASK, + }, + .fs = { + .addr = 0x23, + .mask = 0x30, + .fs_avl = { + [0] = { + .num = ST_ACCEL_FS_AVL_2G, + .value = 0x00, + .gain = IIO_G_TO_M_S_2(1000), + }, + [1] = { + .num = ST_ACCEL_FS_AVL_4G, + .value = 0x01, + .gain = IIO_G_TO_M_S_2(2000), + }, + [2] = { + .num = ST_ACCEL_FS_AVL_8G, + .value = 0x02, + .gain = IIO_G_TO_M_S_2(4000), + }, + [3] = { + .num = ST_ACCEL_FS_AVL_16G, + .value = 0x03, + .gain = IIO_G_TO_M_S_2(12000), + }, + }, + }, + .bdu = { + .addr = 0x23, + .mask = 0x80, + }, + .drdy_irq = { + .int1 = { + .addr = 0x22, + .mask = 0x10, + }, + .addr_ihl = 0x25, + .mask_ihl = 0x02, + .stat_drdy = { + .addr = ST_SENSORS_DEFAULT_STAT_ADDR, + .mask = 0x07, + }, + }, + .sim = { + .addr = 0x23, + .value = BIT(0), + }, + .multi_read_bit = true, + .bootime = 2, + }, }; /* Default accel DRDY is available on INT1 pin */ diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c index c0ce78eebad9..7f5888570e87 100644 --- a/drivers/iio/accel/st_accel_i2c.c +++ b/drivers/iio/accel/st_accel_i2c.c @@ -107,6 +107,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lis2hh12", .data = LIS2HH12_ACCEL_DEV_NAME, }, + { + .compatible = "silan,sc7a20", + .data = SC7A20_ACCEL_DEV_NAME, + }, {}, }; MODULE_DEVICE_TABLE(of, st_accel_of_match); @@ -142,6 +146,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LIS3DE_ACCEL_DEV_NAME }, { LIS2DE12_ACCEL_DEV_NAME }, { LIS2HH12_ACCEL_DEV_NAME }, + { SC7A20_ACCEL_DEV_NAME }, {}, }; MODULE_DEVICE_TABLE(i2c, st_accel_id_table); -- 2.33.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/3] iio: accel: st_accel: Add support for Silan SC7A20 2022-02-02 23:50 ` [PATCH v2 3/3] iio: accel: st_accel: Add support for Silan SC7A20 Samuel Holland @ 2022-02-03 16:36 ` Linus Walleij 0 siblings, 0 replies; 11+ messages in thread From: Linus Walleij @ 2022-02-03 16:36 UTC (permalink / raw) To: Samuel Holland Cc: Jonathan Cameron, Lars-Peter Clausen, Denis Ciocca, Rob Herring, devicetree, linux-iio, linux-kernel On Thu, Feb 3, 2022 at 12:50 AM Samuel Holland <samuel@sholland.org> wrote: > This chip appears to be register-compatible with the LIS2DH. The new > description is a copy of the LIS2DH's description with a different WAI > value. > > Datasheet: http://linux-chenxing.org/silan/SC7A20-SilanMicroelectronics.pdf > Datasheet: http://www.siitek.com.cn/Upfiles/down/SC7A20说明书_0.92(智能穿戴).pdf > Signed-off-by: Samuel Holland <samuel@sholland.org> > --- > > Changes in v2: > - Add a comment about the WAI value > - Update commit messages Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support 2022-02-02 23:50 [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Samuel Holland ` (2 preceding siblings ...) 2022-02-02 23:50 ` [PATCH v2 3/3] iio: accel: st_accel: Add support for Silan SC7A20 Samuel Holland @ 2022-02-05 17:25 ` Jonathan Cameron 2022-02-13 18:24 ` Jonathan Cameron 4 siblings, 0 replies; 11+ messages in thread From: Jonathan Cameron @ 2022-02-05 17:25 UTC (permalink / raw) To: Samuel Holland Cc: Lars-Peter Clausen, Denis Ciocca, Linus Walleij, Rob Herring, devicetree, linux-iio, linux-kernel On Wed, 2 Feb 2022 17:50:45 -0600 Samuel Holland <samuel@sholland.org> wrote: > This chip is register-compatible with an ST part, so it works without > any issues when added to the existing driver. > > Previously I called it a clone, but it's not really a clone, because > it's not a drop-in replacement for the other chips. The software > interface matches the ST parts, but the pinout does not. Instead, the > pinout matches the Kionix KX122 and KX132. Weird :) I'm fine with the series, but as it contains a new vendor ID and the dt-binding update I'll leave it on list for a bit longer to give Rob time to sanity check that. Thanks, Jonathan > > Changes in v2: > - Move the new compatible to its own section > - Add a comment about the WAI value > - Update commit messages > > Samuel Holland (3): > dt-bindings: vendor-prefixes: Add silan vendor prefix > dt-bindings: iio: st: Add Silan SC7A20 accelerometer > iio: accel: st_accel: Add support for Silan SC7A20 > > .../bindings/iio/st,st-sensors.yaml | 3 + > .../devicetree/bindings/vendor-prefixes.yaml | 2 + > drivers/iio/accel/st_accel.h | 2 + > drivers/iio/accel/st_accel_core.c | 83 +++++++++++++++++++ > drivers/iio/accel/st_accel_i2c.c | 5 ++ > 5 files changed, 95 insertions(+) > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support 2022-02-02 23:50 [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Samuel Holland ` (3 preceding siblings ...) 2022-02-05 17:25 ` [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Jonathan Cameron @ 2022-02-13 18:24 ` Jonathan Cameron 4 siblings, 0 replies; 11+ messages in thread From: Jonathan Cameron @ 2022-02-13 18:24 UTC (permalink / raw) To: Samuel Holland Cc: Lars-Peter Clausen, Denis Ciocca, Linus Walleij, Rob Herring, devicetree, linux-iio, linux-kernel On Wed, 2 Feb 2022 17:50:45 -0600 Samuel Holland <samuel@sholland.org> wrote: > This chip is register-compatible with an ST part, so it works without > any issues when added to the existing driver. > > Previously I called it a clone, but it's not really a clone, because > it's not a drop-in replacement for the other chips. The software > interface matches the ST parts, but the pinout does not. Instead, the > pinout matches the Kionix KX122 and KX132. Series applied to the togreg branch of iio.git and pushed out as testing to see if 0-day can find anything we missed. Thanks, Jonathan > > Changes in v2: > - Move the new compatible to its own section > - Add a comment about the WAI value > - Update commit messages > > Samuel Holland (3): > dt-bindings: vendor-prefixes: Add silan vendor prefix > dt-bindings: iio: st: Add Silan SC7A20 accelerometer > iio: accel: st_accel: Add support for Silan SC7A20 > > .../bindings/iio/st,st-sensors.yaml | 3 + > .../devicetree/bindings/vendor-prefixes.yaml | 2 + > drivers/iio/accel/st_accel.h | 2 + > drivers/iio/accel/st_accel_core.c | 83 +++++++++++++++++++ > drivers/iio/accel/st_accel_i2c.c | 5 ++ > 5 files changed, 95 insertions(+) > ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-02-13 18:17 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-02-02 23:50 [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Samuel Holland 2022-02-02 23:50 ` [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add silan vendor prefix Samuel Holland 2022-02-03 16:35 ` Linus Walleij 2022-02-09 21:59 ` Rob Herring 2022-02-02 23:50 ` [PATCH v2 2/3] dt-bindings: iio: st: Add Silan SC7A20 accelerometer Samuel Holland 2022-02-03 16:35 ` Linus Walleij 2022-02-09 21:59 ` Rob Herring 2022-02-02 23:50 ` [PATCH v2 3/3] iio: accel: st_accel: Add support for Silan SC7A20 Samuel Holland 2022-02-03 16:36 ` Linus Walleij 2022-02-05 17:25 ` [PATCH v2 0/3] iio: Silan SC7A20 accelerometer support Jonathan Cameron 2022-02-13 18:24 ` Jonathan Cameron
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.