Commit ea1c94d7 authored by Angelo Dureghello's avatar Angelo Dureghello Committed by Jonathan Cameron

iio: dac: ad3552r: add support for ad3541r and ad3551r

Add support for single-output DAC variants.
Signed-off-by: default avatarAngelo Dureghello <adureghello@baylibre.com>
Reviewed-by: default avatarNuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240522150141.1776196-5-adureghello@baylibre.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 2334d5e0
......@@ -140,7 +140,9 @@ enum ad3552r_ch_vref_select {
};
enum ad3542r_id {
AD3541R_ID = 0x400b,
AD3542R_ID = 0x4009,
AD3551R_ID = 0x400a,
AD3552R_ID = 0x4008,
};
......@@ -1079,6 +1081,15 @@ static int ad3552r_probe(struct spi_device *spi)
return devm_iio_device_register(&spi->dev, indio_dev);
}
static const struct ad3552r_model_data ad3541r_model_data = {
.model_name = "ad3541r",
.chip_id = AD3541R_ID,
.num_hw_channels = 1,
.ranges_table = ad3542r_ch_ranges,
.num_ranges = ARRAY_SIZE(ad3542r_ch_ranges),
.requires_output_range = true,
};
static const struct ad3552r_model_data ad3542r_model_data = {
.model_name = "ad3542r",
.chip_id = AD3542R_ID,
......@@ -1088,6 +1099,15 @@ static const struct ad3552r_model_data ad3542r_model_data = {
.requires_output_range = true,
};
static const struct ad3552r_model_data ad3551r_model_data = {
.model_name = "ad3551r",
.chip_id = AD3551R_ID,
.num_hw_channels = 1,
.ranges_table = ad3552r_ch_ranges,
.num_ranges = ARRAY_SIZE(ad3552r_ch_ranges),
.requires_output_range = false,
};
static const struct ad3552r_model_data ad3552r_model_data = {
.model_name = "ad3552r",
.chip_id = AD3552R_ID,
......@@ -1098,10 +1118,18 @@ static const struct ad3552r_model_data ad3552r_model_data = {
};
static const struct spi_device_id ad3552r_id[] = {
{
.name = "ad3541r",
.driver_data = (kernel_ulong_t)&ad3541r_model_data
},
{
.name = "ad3542r",
.driver_data = (kernel_ulong_t)&ad3542r_model_data
},
{
.name = "ad3551r",
.driver_data = (kernel_ulong_t)&ad3551r_model_data
},
{
.name = "ad3552r",
.driver_data = (kernel_ulong_t)&ad3552r_model_data
......@@ -1111,7 +1139,9 @@ static const struct spi_device_id ad3552r_id[] = {
MODULE_DEVICE_TABLE(spi, ad3552r_id);
static const struct of_device_id ad3552r_of_match[] = {
{ .compatible = "adi,ad3541r", .data = &ad3541r_model_data },
{ .compatible = "adi,ad3542r", .data = &ad3542r_model_data },
{ .compatible = "adi,ad3551r", .data = &ad3551r_model_data },
{ .compatible = "adi,ad3552r", .data = &ad3552r_model_data },
{ }
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment