| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | 2 | /* |
|---|
| 3 | | - * AD5672R, AD5676, AD5676R, AD5681R, AD5682R, AD5683, AD5683R, |
|---|
| 4 | | - * AD5684, AD5684R, AD5685R, AD5686, AD5686R |
|---|
| 3 | + * AD5672R, AD5674R, AD5676, AD5676R, AD5679R, |
|---|
| 4 | + * AD5681R, AD5682R, AD5683, AD5683R, AD5684, |
|---|
| 5 | + * AD5684R, AD5685R, AD5686, AD5686R |
|---|
| 5 | 6 | * Digital to analog converters driver |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Copyright 2018 Analog Devices Inc. |
|---|
| .. | .. |
|---|
| 19 | 20 | u8 tx_len, *buf; |
|---|
| 20 | 21 | |
|---|
| 21 | 22 | switch (st->chip_info->regmap_type) { |
|---|
| 23 | + case AD5310_REGMAP: |
|---|
| 24 | + st->data[0].d16 = cpu_to_be16(AD5310_CMD(cmd) | |
|---|
| 25 | + val); |
|---|
| 26 | + buf = &st->data[0].d8[0]; |
|---|
| 27 | + tx_len = 2; |
|---|
| 28 | + break; |
|---|
| 22 | 29 | case AD5683_REGMAP: |
|---|
| 23 | 30 | st->data[0].d32 = cpu_to_be32(AD5686_CMD(cmd) | |
|---|
| 24 | 31 | AD5683_DATA(val)); |
|---|
| .. | .. |
|---|
| 56 | 63 | u8 cmd = 0; |
|---|
| 57 | 64 | int ret; |
|---|
| 58 | 65 | |
|---|
| 59 | | - if (st->chip_info->regmap_type == AD5686_REGMAP) |
|---|
| 60 | | - cmd = AD5686_CMD_READBACK_ENABLE; |
|---|
| 61 | | - else if (st->chip_info->regmap_type == AD5683_REGMAP) |
|---|
| 66 | + switch (st->chip_info->regmap_type) { |
|---|
| 67 | + case AD5310_REGMAP: |
|---|
| 68 | + return -ENOTSUPP; |
|---|
| 69 | + case AD5683_REGMAP: |
|---|
| 62 | 70 | cmd = AD5686_CMD_READBACK_ENABLE_V2; |
|---|
| 71 | + break; |
|---|
| 72 | + case AD5686_REGMAP: |
|---|
| 73 | + cmd = AD5686_CMD_READBACK_ENABLE; |
|---|
| 74 | + break; |
|---|
| 75 | + default: |
|---|
| 76 | + return -EINVAL; |
|---|
| 77 | + } |
|---|
| 63 | 78 | |
|---|
| 64 | 79 | st->data[0].d32 = cpu_to_be32(AD5686_CMD(cmd) | |
|---|
| 65 | 80 | AD5686_ADDR(addr)); |
|---|
| .. | .. |
|---|
| 86 | 101 | } |
|---|
| 87 | 102 | |
|---|
| 88 | 103 | static const struct spi_device_id ad5686_spi_id[] = { |
|---|
| 104 | + {"ad5310r", ID_AD5310R}, |
|---|
| 89 | 105 | {"ad5672r", ID_AD5672R}, |
|---|
| 106 | + {"ad5674r", ID_AD5674R}, |
|---|
| 90 | 107 | {"ad5676", ID_AD5676}, |
|---|
| 91 | 108 | {"ad5676r", ID_AD5676R}, |
|---|
| 109 | + {"ad5679r", ID_AD5679R}, |
|---|
| 92 | 110 | {"ad5681r", ID_AD5681R}, |
|---|
| 93 | 111 | {"ad5682r", ID_AD5682R}, |
|---|
| 94 | 112 | {"ad5683", ID_AD5683}, |
|---|