Enable AK8963 conneted via INV6500
Subsystems (3)
cover Enable AK8963 conneted via INV6500
Now we have i2c-mux for invensense mpu6050/mpu6500 is merged, this patchset enables sensors routed through this.
In this series enabling AK8975/AK8963. This device is connected to main cpu i2c bus via invensense bypass mode enabled by i2c-mux.
Srinivas Pandruvada (3):
iio: imu: inv_mpu6050: ACPI enumeration
iio: imu: inv_mpu6050: Added adapter class
iio: ak8975: Added autodetect feature for ACPI
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 11 +++++++++- drivers/iio/magnetometer/ak8975.c | 35 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.3
PATCH 1/3 iio: imu: inv_mpu6050: ACPI enumeration
Added changes so that the module can be enumerated via ACPI.
--- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +9 -0
@@ -24,6 +24,7 @@#include <linux/spinlock.h> #include <linux/iio/iio.h> #include <linux/i2c-mux.h> +#include <linux/acpi.h> #include "inv_mpu_iio.h" /*
@@ -875,6 +876,13 @@ static const struct i2c_device_id inv_mpu_id[] = {MODULE_DEVICE_TABLE (i2c, inv_mpu_id); +static const struct acpi_device_id inv_acpi_match[] = { + {"INVN6500" ,0 }, + { }, +}; + +MODULE_DEVICE_TABLE (acpi, inv_acpi_match); +static struct i2c_driver inv_mpu_driver = { .probe = inv_mpu_probe, .remove = inv_mpu_remove,
@@ -883,6 +891,7 @@ static struct i2c_driver inv_mpu_driver = { .owner = THIS_MODULE, .name = "inv-mpu6050", .pm = INV_MPU6050_PMOPS, + .acpi_match_table = ACPI_PTR(inv_acpi_match), }, };
Signature · 1 line
1.9.3
Re: [PATCH 1/3] iio: imu: inv_mpu6050: ACPI enumeration
Quoted 3 lines · Srinivas Pandruvada
Added changes so that the module can be enumerated via ACPI.
Signed-off-by Srinivas Pandruvada <[email protected]>
As this one stands on it's own.
Applied to the togreg branch of iio.git.
Thanks
Jonathan
Quoted 39 lines
--- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +9
-0@@ -24,6 +24,7 @@#include <linux/spinlock.h> #include <linux/iio/iio.h> #include <linux/i2c-mux.h> +#include <linux/acpi.h> #include "inv_mpu_iio.h" /* @@ -875,6 +876,13 @@ static const struct i2c_device_id inv_mpu_id[] = {MODULE_DEVICE_TABLE (i2c, inv_mpu_id); +static const struct acpi_device_id inv_acpi_match[] = { + {"INVN6500" ,0 }, + { }, +}; + +MODULE_DEVICE_TABLE (acpi, inv_acpi_match); +static struct i2c_driver inv_mpu_driver = { .probe = inv_mpu_probe, .remove = inv_mpu_remove,@@ -883,6 +891,7 @@ static struct i2c_driver inv_mpu_driver = { .owner = THIS_MODULE, .name = "inv-mpu6050", .pm = INV_MPU6050_PMOPS, + .acpi_match_table = ACPI_PTR(inv_acpi_match), }, };
PATCH 2/3 iio: imu: inv_mpu6050: Added adapter class
In reply to Srinivas PandruvadaTo use i2c auto detect to work we need to have a non zero class. The closest class is I2C_CLASS_HWMON, as it defined to be used with all hw monitoring drivers.
Also this class is already used by some iio driver, hid drivers, led and misc drivers. So this is not new that this is used outside hwmon drivers.
--- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +1 -1
@@ -813,7 +813,7 @@ static int inv_mpu_probe(struct i2c_client *client, st->mux_adapter =i2c_add_mux_adapter (client->adapter, &client->dev, indio_dev, -0 ,0 ,0 , +0 ,0 ,I2C_CLASS_HWMON , inv_mpu6050_select_bypass, inv_mpu6050_deselect_bypass);if (!st->mux_adapter) {
Signature · 1 line
1.9.3
Jonathan Cameron
maintainerRe: [PATCH 2/3] iio: imu: inv_mpu6050: Added adapter class
Quoted 9 lines · Srinivas Pandruvada
To use i2c auto detect to work we need to have a non zero class. The closest class is
I2C_CLASS_HWMON, as it defined to be used with all hw monitoring drivers.Also this class is already used by some iio driver, hid drivers, led and misc drivers. So this is not new that this is used outside hwmon drivers.
Signed-off-by Srinivas Pandruvada <[email protected]>
Been meaning to sort this out for a while. We really shouldn't be camping on the HWMON class (nor should anyone else).
Wolfram, do you mind new classes being added?
Quoted 18 lines
--- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +1
-1@@ -813,7 +813,7 @@ static int inv_mpu_probe(struct i2c_client *client, st->mux_adapter =i2c_add_mux_adapter (client->adapter, &client->dev, indio_dev, -0 ,0 ,0 , +0 ,0 ,I2C_CLASS_HWMON , inv_mpu6050_select_bypass, inv_mpu6050_deselect_bypass);if (!st->mux_adapter) {
Re: [PATCH 2/3] iio: imu: inv_mpu6050: Added adapter class
Quoted 9 lines · Jonathan Cameron
Quoted 8 lines · Srinivas Pandruvada
To use i2c auto detect to work we need to have a non zero class. The closest class is
I2C_CLASS_HWMON, as it defined to be used with all hw monitoring drivers.Also this class is already used by some iio driver, hid drivers, led and misc drivers. So this is not new that this is used outside hwmon drivers.
Quoted 5 lines
Quoted 1 line
Signed-off-by Srinivas Pandruvada <[email protected]>Been meaning to sort this out for a while. We really shouldn't be camping on the HWMON class (nor should anyone else).
Wolfram, do you mind new classes being added?
In general, I wouldn't mind but I wonder if it makes sense here. DDC and SPD are very special I2C uses where access should be limited, so a seperate class makes sense IMO. HWMON has a specific name, but really became "everything what people could hook to their I2C bus" these days. So, if anything, we could think about renaming I2C_CLASS_HWMON to I2C_CLASS_STANDARD or something (or at least add a comment about that in i2c.h)? I'd think IIO devices fall into the default category. Please say if you think different. If we'd add the IIO class, most drivers will need patches to support IIO devices which would have worked otherwise, so this change should be justified.
@Jean: Do you have anything to add?
Jonathan Cameron
maintainerRe: [PATCH 2/3] iio: imu: inv_mpu6050: Added adapter class
Quoted 16 lines · Wolfram Sang
Quoted 9 lines · Jonathan Cameron
Quoted 8 lines · Srinivas Pandruvada
To use i2c auto detect to work we need to have a non zero class. The closest class is
I2C_CLASS_HWMON, as it defined to be used with all hw monitoring drivers.Also this class is already used by some iio driver, hid drivers, led and misc drivers. So this is not new that this is used outside hwmon drivers.
Quoted 5 lines
Quoted 1 line
Signed-off-by Srinivas Pandruvada <[email protected]>Been meaning to sort this out for a while. We really shouldn't be camping on the HWMON class (nor should anyone else).
Wolfram, do you mind new classes being added?
Quoted 10 lines
In general, I wouldn't mind but I wonder if it makes sense here. DDC and SPD are very special I2C uses where access should be limited, so a seperate class makes sense IMO. HWMON has a specific name, but really became "everything what people could hook to their I2C bus" these days. So, if anything, we could think about renaming
I2C_CLASS_HWMONtoI2C_CLASS_STANDARDor something (or at least add a comment about that ini2c.h)? I'd think IIO devices fall into the default category. Please say if you think different. If we'd add the IIO class, most drivers will need patches to support IIO devices which would have worked otherwise, so this change should be justified.
The I2C_CLASS_STANDARD option sounds sensible - though perhaps the comment would be quicker ;)
Quoted 8 lines
@Jean: Do you have anything to add?
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] iio: imu: inv_mpu6050: Added adapter class
In reply to Wolfram SangHi Wolfram,
First of all, happy new year :-)
Quoted 6 lines · Wolfram Sang
Quoted 5 lines · Jonathan Cameron
Quoted 4 lines · Srinivas Pandruvada
To use i2c auto detect to work we need to have a non zero class. The closest class is
I2C_CLASS_HWMON, as it defined to be used with all hw monitoring drivers.
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Also this class is already used by some iio driver, hid drivers, led and misc drivers. So this is not new that this is used outside hwmon drivers.
Signed-off-by Srinivas Pandruvada <[email protected]>Been meaning to sort this out for a while. We really shouldn't be camping on the HWMON class (nor should anyone else).
This is correct, side effects could be quite bad.
Quoted 6 lines
Quoted 1 line
Wolfram, do you mind new classes being added?
In general, I wouldn't mind but I wonder if it makes sense here. DDC and SPD are very special I2C uses where access should be limited, so a seperate class makes sense IMO. HWMON has a specific name, but really became "everything what people could hook to their I2C bus" these days.
HWMON is there mainly for historical reasons, which still hold due to the inability of PC hardware vendors to list which I2C devices are connected to the SMBus (although this is changing, ACPI could help to some degree now.)
Quoted 8 lines
So, if anything, we could think about renaming
I2C_CLASS_HWMONtoI2C_CLASS_STANDARDor something (or at least add a comment about that ini2c.h)? I'd think IIO devices fall into the default category. Please say if you think different. If we'd add the IIO class, most drivers will need patches to support IIO devices which would have worked otherwise, so this change should be justified.@Jean: Do you have anything to add?
I2C_CLASS_STANDARD sounds like a rather bad idea to me. But really I miss the background for the discussion so it's hard for me to make an educated comment.
Please keep in mind that I2C_CLASS_* is not about which class I2C devices (or even device drivers) belong to. It is about which drivers should actively _probe_ for their devices on which I2C bus segments. This is, in general, a bad idea and should be avoided as much as possible, in favor of enumeration. I2C device probing is inefficient, unreliable and dangerous by nature.
The reason why we still do it for DDC and SPD is because the range of addresses is very limited, and probing is somewhat part of the specification. The reason why we do it for HWMON is because enumeration does not exist at the hardware level on popular platforms. For everything else we have backed out (analog and digital TV, in particular.)
So I am wondering, which platforms are using IIO drivers and do not support device enumeration at the firmware / device tree level?
Signature · 2 lines
Jean Delvare SUSE L3 Support
PATCH 3/3 iio: ak8975: Added autodetect feature for ACPI
In reply to Srinivas PandruvadaUsing i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.
--- drivers/iio/magnetometer/ak8975.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/iio/magnetometer/ak8975.c +35 -0
@@ -820,6 +820,36 @@ static const struct i2c_device_id ak8975_id[] = {MODULE_DEVICE_TABLE (i2c, ak8975_id); +#if defined(CONFIG_ACPI ) +static int ak8975_detect (struct i2c_client *temp_client, +struct i2c_board_info *info) +{ +struct i2c_adapter *adapter; +int i, j; +int ret; + +/* autodetect only when we are behind a mux */ + adapter =i2c_parent_is_i2c_adapter (temp_client->adapter); +if (!adapter) +return -ENODEV ; + +for (i =0 ; i <AK_MAX_TYPE ; ++i) { + ret =ak8975_who_i_am (temp_client, i); +if (ret >=0 ) { +for (j =0 ; j <ARRAY_SIZE (ak8975_id) -1 ; ++j) { +if (i == (int )ak8975_id[j].driver_data) { +strlcpy (info->type, ak8975_id[j].name, +I2C_NAME_SIZE ); +return 0 ; + } + } + } + } + +return -ENODEV ; +} +#endif +static const struct of_device_id ak8975_of_match[] = { { .compatible ="asahi-kasei,ak8975" , }, { .compatible ="ak8975" , },
@@ -841,6 +871,11 @@ static struct i2c_driver ak8975_driver = { }, .probe = ak8975_probe, .id_table = ak8975_id, +#if defined(CONFIG_ACPI ) + .class = I2C_CLASS_HWMON, + .address_list = I2C_ADDRS(0x0C, 0x0D, 0x0E, 0x0F), + .detect = ak8975_detect, +#endif };module_i2c_driver (ak8975_driver);
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1418678363-22437-4-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/[email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Added I2C to Cc.
Quoted 8 lines · Srinivas Pandruvada
Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.
This is quite a bit of a hack. Did they decide to not include the device in the ACPI description at all or is there a special id for INV6050+AK8975?
How does Windows decide whether there is a device or not?
Quoted 47 lines
--- drivers/iio/magnetometer/ak8975.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)drivers/iio/magnetometer/ak8975.c +30
-0@@ -820,6 +820,36 @@ static const struct i2c_device_id ak8975_id[] = {MODULE_DEVICE_TABLE (i2c, ak8975_id); +#if defined(CONFIG_ACPI ) +static int ak8975_detect (struct i2c_client *temp_client, +struct i2c_board_info *info) +{ +struct i2c_adapter *adapter; +int i, j; +int ret; + +/* autodetect only when we are behind a mux */ + adapter =i2c_parent_is_i2c_adapter (temp_client->adapter); +if (!adapter) +return -ENODEV ; + +for (i =0 ; i <AK_MAX_TYPE ; ++i) { + ret =ak8975_who_i_am (temp_client, i); +if (ret >=0 ) { +for (j =0 ; j <ARRAY_SIZE (ak8975_id) -1 ; ++j) { +if (i == (int )ak8975_id[j].driver_data) { +strlcpy (info->type, ak8975_id[j].name, +I2C_NAME_SIZE ); +return 0 ; + } + } + } + } + +return -ENODEV ; +} +#endif +static const struct of_device_id ak8975_of_match[] = { { .compatible ="asahi-kasei,ak8975" , }, { .compatible ="ak8975" , },
drivers/iio/magnetometer/ak8975.c static struct i2c_driver ak8975_driver = { · line 877
Quoted 7 lines
drivers/iio/magnetometer/ak8975.c +4
-0@@ -841,6 +871,11 @@ static struct i2c_driver ak8975_driver = { }, .probe = ak8975_probe, .id_table = ak8975_id, +#if defined(CONFIG_ACPI ) + .class = I2C_CLASS_HWMON, + .address_list = I2C_ADDRS(0x0C, 0x0D, 0x0E, 0x0F), + .detect = ak8975_detect,
In contrast to the commit message this is always enabled if the kernel contains ACPI support, not if the device is a ACPI device.
Quoted 5 lines
drivers/iio/magnetometer/ak8975.c +1
-0+#endif };module_i2c_driver (ak8975_driver);
A message that is not in the archive (sent off-list or not yet received): 549300A5.5080904-Qo5EllUWu/[email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 12 lines · Lars-Peter Clausen
Added I2C to Cc.
Quoted 8 lines · Srinivas Pandruvada
Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.
Quoted 1 line
This is quite a bit of a hack.
Why?
Auto detect is standard feature of i2c devices. This is using standard auto detect feature provided by the framework.
Quoted 2 lines
Did they decide to not include the device in
the ACPI description at all or is there a special id for INV6050+AK8975?
This device needs has one combined id. Windows has a singe driver processing both as a combo device.
Quoted 51 lines
How does Windows decide whether there is a device or not?
Quoted 49 lines
--- drivers/iio/magnetometer/ak8975.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)drivers/iio/magnetometer/ak8975.c +30
-0@@ -820,6 +820,36 @@ static const struct i2c_device_id ak8975_id[] = {MODULE_DEVICE_TABLE (i2c, ak8975_id); +#if defined(CONFIG_ACPI ) +static int ak8975_detect (struct i2c_client *temp_client, +struct i2c_board_info *info) +{ +struct i2c_adapter *adapter; +int i, j; +int ret; + +/* autodetect only when we are behind a mux */ + adapter =i2c_parent_is_i2c_adapter (temp_client->adapter); +if (!adapter) +return -ENODEV ; + +for (i =0 ; i <AK_MAX_TYPE ; ++i) { + ret =ak8975_who_i_am (temp_client, i); +if (ret >=0 ) { +for (j =0 ; j <ARRAY_SIZE (ak8975_id) -1 ; ++j) { +if (i == (int )ak8975_id[j].driver_data) { +strlcpy (info->type, ak8975_id[j].name, +I2C_NAME_SIZE ); +return 0 ; + } + } + } + } + +return -ENODEV ; +} +#endif +static const struct of_device_id ak8975_of_match[] = { { .compatible ="asahi-kasei,ak8975" , }, { .compatible ="ak8975" , },@@ -841,6 +871,11 @@ static struct i2c_driver ak8975_driver = { }, .probe = ak8975_probe,
Quoted 8 lines
drivers/iio/magnetometer/ak8975.c static struct i2c_driver ak8975_driver = { · line 877
Quoted 5 lines
drivers/iio/magnetometer/ak8975.c +4
-0.id_table = ak8975_id, +#if defined(CONFIG_ACPI ) + .class = I2C_CLASS_HWMON, + .address_list = I2C_ADDRS(0x0C, 0x0D, 0x0E, 0x0F), + .detect = ak8975_detect,In contrast to the commit message this is always enabled if the kernel contains ACPI support, not if the device is a ACPI device.
Yes. You don't enable ACPI if you don't need it. It will bring in lots of builtin code if someone did that.
Quoted 7 lines
Quoted 6 lines
drivers/iio/magnetometer/ak8975.c +1
-0+#endif };module_i2c_driver (ak8975_driver);
A message that is not in the archive (sent off-list or not yet received): 1418921521.740.282.camel-hINH/TbAiWppyMZ9rn1DP+ejPoqOX1/[email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 13 lines · Srinivas Pandruvada
Quoted 12 lines · Lars-Peter Clausen
Added I2C to Cc.
Quoted 8 lines · Srinivas Pandruvada
Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.
Quoted 4 lines
Quoted 1 line
This is quite a bit of a hack.
Why?
Auto detect is standard feature of i2c devices. This is using standard auto detect feature provided by the framework.
Auto detect is ugly, slow and unreliable, it's kind of like the last straw if nothing else works.
Autodetect will be executed for every adapter with every device that supports auto detection, so you want to keep the amount of devices that do auto detection to a minimum in order to avoid both false positives and reduce boot time.
Quoted 4 lines
Quoted 2 lines
Did they decide to not include the device in
the ACPI description at all or is there a special id for INV6050+AK8975?This device needs has one combined id. Windows has a singe driver processing both as a combo device.
Ok, then use the combined id to instantiate INV6050+AK8975.
- Lars
A message that is not in the archive (sent off-list or not yet received): 54930965.3030008-Qo5EllUWu/[email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 14 lines · Lars-Peter Clausen
Quoted 13 lines · Srinivas Pandruvada
Quoted 12 lines · Lars-Peter Clausen
Added I2C to Cc.
Quoted 8 lines · Srinivas Pandruvada
Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
This is quite a bit of a hack.
Why?
Auto detect is standard feature of i2c devices. This is using standard auto detect feature provided by the framework.Auto detect is ugly, slow and unreliable, it's kind of like the last straw if nothing else works.
That is true here. You can't enumerate this device by ACPI. As discussed before we created i2c mux in inv6050 so that we can use AK8975 in bypass mode. I added some API to create i2c device on this mux, which Wolfram didn't like. He wanted to enumerate using existing mechanisms.
Quoted 7 lines
Autodetect will be executed for every adapter with every device that supports auto detection, so you want to keep the amount of devices that do auto detection to a minimum in order to avoid both false positives and reduce boot time.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Did they decide to not include the device in
the ACPI description at all or is there a special id for INV6050+AK8975?This device needs has one combined id. Windows has a singe driver processing both as a combo device.
Ok, then use the combined id to instantiate INV6050+AK8975.
No. The i2c address address is already consumed by INV6050 driver (which is valid for INV6050 not AK8975).
Quoted 3 lines
- Lars
A message that is not in the archive (sent off-list or not yet received): 1418923812.4459.8.camel-hINH/TbAiWppyMZ9rn1DP+ejPoqOX1/[email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 20 lines · Srinivas Pandruvada
Quoted 19 lines · Lars-Peter Clausen
Quoted 17 lines · Srinivas Pandruvada
Quoted 12 lines · Lars-Peter Clausen
Added I2C to Cc.
Quoted 8 lines · Srinivas Pandruvada
Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.Quoted 1 line
This is quite a bit of a hack.
Why?
Auto detect is standard feature of i2c devices. This is using standard auto detect feature provided by the framework.
Quoted 6 lines
Quoted 2 lines
Auto detect is ugly, slow and unreliable, it's kind of like the last straw if nothing else works.
That is true here. You can't enumerate this device by ACPI. As discussed before we created i2c mux in inv6050 so that we can use AK8975 in bypass mode. I added some API to create i2c device on this mux, which Wolfram didn't like. He wanted to enumerate using existing mechanisms.
If there is only a single ACPI ID that says this is a INV6050 with a AK8975 attached then the way to handle this is to have a driver that binds to that id and creates both devices.
- Lars
A message that is not in the archive (sent off-list or not yet received): 549314C4.8090001-Qo5EllUWu/[email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 23 lines · Lars-Peter Clausen
Quoted 22 lines · Srinivas Pandruvada
Quoted 21 lines · Lars-Peter Clausen
Quoted 13 lines · Srinivas Pandruvada
Quoted 12 lines · Lars-Peter Clausen
Added I2C to Cc.
Quoted 8 lines · Srinivas Pandruvada
Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.Quoted 4 lines
Quoted 1 line
This is quite a bit of a hack.
Why?
Auto detect is standard feature of i2c devices. This is using standard auto detect feature provided by the framework.Auto detect is ugly, slow and unreliable, it's kind of like the last straw if nothing else works.
Quoted 8 lines
Quoted 4 lines
That is true here. You can't enumerate this device by ACPI. As discussed before we created i2c mux in inv6050 so that we can use AK8975 in bypass mode. I added some API to create i2c device on this mux, which Wolfram didn't like. He wanted to enumerate using existing mechanisms.
If there is only a single ACPI ID that says this is a INV6050 with a AK8975 attached then the way to handle this is to have a driver that binds to that id and creates both devices.
Which address you will create device also adapter here is i2c mux created by inv6050? You don't know i2c address of AK8975. To know AK8975 i2c address, even ugly hack to parse propriety vendor ACPI data, which will change between to manufacturer.
Quoted 3 lines
- Lars
A message that is not in the archive (sent off-list or not yet received): 1418925641.4459.11.camel-hINH/TbAiWppyMZ9rn1DP+ejPoqOX1/[email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 29 lines · Srinivas Pandruvada
Quoted 28 lines · Lars-Peter Clausen
Quoted 26 lines · Srinivas Pandruvada
Quoted 14 lines · Lars-Peter Clausen
Quoted 13 lines · Srinivas Pandruvada
Quoted 12 lines · Lars-Peter Clausen
Added I2C to Cc.
Quoted 8 lines · Srinivas Pandruvada
Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence.
This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI. This will enable ak8975 on windows based tablets/laptops running Linux when connected via a mux. Since DT model already can define an i2c mux and devices connected to it, this feature is only enabled for ACPI.Quoted 7 lines
Quoted 4 lines
Quoted 1 line
This is quite a bit of a hack.
Why?
Auto detect is standard feature of i2c devices. This is using standard auto detect feature provided by the framework.Auto detect is ugly, slow and unreliable, it's kind of like the last straw if nothing else works.
That is true here. You can't enumerate this device by ACPI. As discussed before we created i2c mux in inv6050 so that we can use AK8975 in bypass mode. I added some API to create i2c device on this mux, which Wolfram didn't like. He wanted to enumerate using existing mechanisms.
Quoted 8 lines
Quoted 3 lines
If there is only a single ACPI ID that says this is a INV6050 with a AK8975 attached then the way to handle this is to have a driver that binds to that id and creates both devices.
Which address you will create device also adapter here is i2c mux created by inv6050? You don't know i2c address of AK8975. To know AK8975 i2c address, even ugly hack to parse propriety vendor ACPI data, which will change between to manufacturer.
This is odd enough, that I'd like a wider range of views on it.
Wolfram - was this the approach you had in mind?
Quoted 5 lines
Quoted 3 lines
- Lars
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 4 lines
This is odd enough, that I'd like a wider range of views on it.
Wolfram - was this the approach you had in mind?
Sorry, too busy with other stuff at this moment :(
Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI
Quoted 6 lines · Wolfram Sang
Quoted 3 lines
This is odd enough, that I'd like a wider range of views on it.
Wolfram - was this the approach you had in mind?
Sorry, too busy with other stuff at this moment :(
I will find some other way without using auto detect feature.