mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
iio: magnetometer: ak8975: Fix 'Unexpected device' error
commit 848f68c760ab1e14a9046ea6e45e3304ab9fa50b upstream.
Explicity specify array indices to fix mapping between
asahi_compass_chipset and ak_def_array.
While at it, remove unneeded AKXXXX.
Fixes: 4f9ea93afde1 ("iio: magnetometer: ak8975: Convert enum->pointer for data in the match tables")
Signed-off-by: André Apitzsch <git@apitzsch.eu>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231001-ak_magnetometer-v1-1-09bf3b8798a3@apitzsch.eu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
85045e51c7
commit
97ab365243
@@ -204,7 +204,6 @@ static long ak09912_raw_to_gauss(u16 data)
|
|||||||
|
|
||||||
/* Compatible Asahi Kasei Compass parts */
|
/* Compatible Asahi Kasei Compass parts */
|
||||||
enum asahi_compass_chipset {
|
enum asahi_compass_chipset {
|
||||||
AKXXXX = 0,
|
|
||||||
AK8975,
|
AK8975,
|
||||||
AK8963,
|
AK8963,
|
||||||
AK09911,
|
AK09911,
|
||||||
@@ -248,7 +247,7 @@ struct ak_def {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct ak_def ak_def_array[] = {
|
static const struct ak_def ak_def_array[] = {
|
||||||
{
|
[AK8975] = {
|
||||||
.type = AK8975,
|
.type = AK8975,
|
||||||
.raw_to_gauss = ak8975_raw_to_gauss,
|
.raw_to_gauss = ak8975_raw_to_gauss,
|
||||||
.range = 4096,
|
.range = 4096,
|
||||||
@@ -273,7 +272,7 @@ static const struct ak_def ak_def_array[] = {
|
|||||||
AK8975_REG_HYL,
|
AK8975_REG_HYL,
|
||||||
AK8975_REG_HZL},
|
AK8975_REG_HZL},
|
||||||
},
|
},
|
||||||
{
|
[AK8963] = {
|
||||||
.type = AK8963,
|
.type = AK8963,
|
||||||
.raw_to_gauss = ak8963_09911_raw_to_gauss,
|
.raw_to_gauss = ak8963_09911_raw_to_gauss,
|
||||||
.range = 8190,
|
.range = 8190,
|
||||||
@@ -298,7 +297,7 @@ static const struct ak_def ak_def_array[] = {
|
|||||||
AK8975_REG_HYL,
|
AK8975_REG_HYL,
|
||||||
AK8975_REG_HZL},
|
AK8975_REG_HZL},
|
||||||
},
|
},
|
||||||
{
|
[AK09911] = {
|
||||||
.type = AK09911,
|
.type = AK09911,
|
||||||
.raw_to_gauss = ak8963_09911_raw_to_gauss,
|
.raw_to_gauss = ak8963_09911_raw_to_gauss,
|
||||||
.range = 8192,
|
.range = 8192,
|
||||||
@@ -323,7 +322,7 @@ static const struct ak_def ak_def_array[] = {
|
|||||||
AK09912_REG_HYL,
|
AK09912_REG_HYL,
|
||||||
AK09912_REG_HZL},
|
AK09912_REG_HZL},
|
||||||
},
|
},
|
||||||
{
|
[AK09912] = {
|
||||||
.type = AK09912,
|
.type = AK09912,
|
||||||
.raw_to_gauss = ak09912_raw_to_gauss,
|
.raw_to_gauss = ak09912_raw_to_gauss,
|
||||||
.range = 32752,
|
.range = 32752,
|
||||||
@@ -348,7 +347,7 @@ static const struct ak_def ak_def_array[] = {
|
|||||||
AK09912_REG_HYL,
|
AK09912_REG_HYL,
|
||||||
AK09912_REG_HZL},
|
AK09912_REG_HZL},
|
||||||
},
|
},
|
||||||
{
|
[AK09916] = {
|
||||||
.type = AK09916,
|
.type = AK09916,
|
||||||
.raw_to_gauss = ak09912_raw_to_gauss,
|
.raw_to_gauss = ak09912_raw_to_gauss,
|
||||||
.range = 32752,
|
.range = 32752,
|
||||||
|
|||||||
Reference in New Issue
Block a user