1d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 247298897SPhilippe Reynes /* 347298897SPhilippe Reynes * iio/dac/max5821.c 447298897SPhilippe Reynes * Copyright (C) 2014 Philippe Reynes 547298897SPhilippe Reynes */ 647298897SPhilippe Reynes 747298897SPhilippe Reynes #include <linux/kernel.h> 847298897SPhilippe Reynes #include <linux/module.h> 947298897SPhilippe Reynes #include <linux/i2c.h> 1047298897SPhilippe Reynes #include <linux/iio/iio.h> 1147298897SPhilippe Reynes #include <linux/regulator/consumer.h> 1247298897SPhilippe Reynes 1347298897SPhilippe Reynes #define MAX5821_MAX_DAC_CHANNELS 2 1447298897SPhilippe Reynes 1547298897SPhilippe Reynes /* command bytes */ 1647298897SPhilippe Reynes #define MAX5821_LOAD_DAC_A_IN_REG_B 0x00 1747298897SPhilippe Reynes #define MAX5821_LOAD_DAC_B_IN_REG_A 0x10 1847298897SPhilippe Reynes #define MAX5821_EXTENDED_COMMAND_MODE 0xf0 1947298897SPhilippe Reynes #define MAX5821_READ_DAC_A_COMMAND 0xf1 2047298897SPhilippe Reynes #define MAX5821_READ_DAC_B_COMMAND 0xf2 2147298897SPhilippe Reynes 2247298897SPhilippe Reynes #define MAX5821_EXTENDED_POWER_UP 0x00 2347298897SPhilippe Reynes #define MAX5821_EXTENDED_POWER_DOWN_MODE0 0x01 2447298897SPhilippe Reynes #define MAX5821_EXTENDED_POWER_DOWN_MODE1 0x02 2547298897SPhilippe Reynes #define MAX5821_EXTENDED_POWER_DOWN_MODE2 0x03 2647298897SPhilippe Reynes #define MAX5821_EXTENDED_DAC_A 0x04 2747298897SPhilippe Reynes #define MAX5821_EXTENDED_DAC_B 0x08 2847298897SPhilippe Reynes 2947298897SPhilippe Reynes enum max5821_device_ids { 3047298897SPhilippe Reynes ID_MAX5821, 3147298897SPhilippe Reynes }; 3247298897SPhilippe Reynes 3347298897SPhilippe Reynes struct max5821_data { 3447298897SPhilippe Reynes struct i2c_client *client; 3547298897SPhilippe Reynes struct regulator *vref_reg; 3647298897SPhilippe Reynes unsigned short vref_mv; 3747298897SPhilippe Reynes bool powerdown[MAX5821_MAX_DAC_CHANNELS]; 3847298897SPhilippe Reynes u8 powerdown_mode[MAX5821_MAX_DAC_CHANNELS]; 3947298897SPhilippe Reynes struct mutex lock; 4047298897SPhilippe Reynes }; 4147298897SPhilippe Reynes 4247298897SPhilippe Reynes static const char * const max5821_powerdown_modes[] = { 4347298897SPhilippe Reynes "three_state", 4447298897SPhilippe Reynes "1kohm_to_gnd", 4547298897SPhilippe Reynes "100kohm_to_gnd", 4647298897SPhilippe Reynes }; 4747298897SPhilippe Reynes 4847298897SPhilippe Reynes enum { 4947298897SPhilippe Reynes MAX5821_THREE_STATE, 5047298897SPhilippe Reynes MAX5821_1KOHM_TO_GND, 5147298897SPhilippe Reynes MAX5821_100KOHM_TO_GND 5247298897SPhilippe Reynes }; 5347298897SPhilippe Reynes 5447298897SPhilippe Reynes static int max5821_get_powerdown_mode(struct iio_dev *indio_dev, 5547298897SPhilippe Reynes const struct iio_chan_spec *chan) 5647298897SPhilippe Reynes { 5747298897SPhilippe Reynes struct max5821_data *st = iio_priv(indio_dev); 5847298897SPhilippe Reynes 5947298897SPhilippe Reynes return st->powerdown_mode[chan->channel]; 6047298897SPhilippe Reynes } 6147298897SPhilippe Reynes 6247298897SPhilippe Reynes static int max5821_set_powerdown_mode(struct iio_dev *indio_dev, 6347298897SPhilippe Reynes const struct iio_chan_spec *chan, 6447298897SPhilippe Reynes unsigned int mode) 6547298897SPhilippe Reynes { 6647298897SPhilippe Reynes struct max5821_data *st = iio_priv(indio_dev); 6747298897SPhilippe Reynes 6847298897SPhilippe Reynes st->powerdown_mode[chan->channel] = mode; 6947298897SPhilippe Reynes 7047298897SPhilippe Reynes return 0; 7147298897SPhilippe Reynes } 7247298897SPhilippe Reynes 7347298897SPhilippe Reynes static const struct iio_enum max5821_powerdown_mode_enum = { 7447298897SPhilippe Reynes .items = max5821_powerdown_modes, 7547298897SPhilippe Reynes .num_items = ARRAY_SIZE(max5821_powerdown_modes), 7647298897SPhilippe Reynes .get = max5821_get_powerdown_mode, 7747298897SPhilippe Reynes .set = max5821_set_powerdown_mode, 7847298897SPhilippe Reynes }; 7947298897SPhilippe Reynes 8047298897SPhilippe Reynes static ssize_t max5821_read_dac_powerdown(struct iio_dev *indio_dev, 8147298897SPhilippe Reynes uintptr_t private, 8247298897SPhilippe Reynes const struct iio_chan_spec *chan, 8347298897SPhilippe Reynes char *buf) 8447298897SPhilippe Reynes { 8547298897SPhilippe Reynes struct max5821_data *st = iio_priv(indio_dev); 8647298897SPhilippe Reynes 87f46ac009SLars-Peter Clausen return sysfs_emit(buf, "%d\n", st->powerdown[chan->channel]); 8847298897SPhilippe Reynes } 8947298897SPhilippe Reynes 9047298897SPhilippe Reynes static int max5821_sync_powerdown_mode(struct max5821_data *data, 9147298897SPhilippe Reynes const struct iio_chan_spec *chan) 9247298897SPhilippe Reynes { 9347298897SPhilippe Reynes u8 outbuf[2]; 9447298897SPhilippe Reynes 9547298897SPhilippe Reynes outbuf[0] = MAX5821_EXTENDED_COMMAND_MODE; 9647298897SPhilippe Reynes 9747298897SPhilippe Reynes if (chan->channel == 0) 9847298897SPhilippe Reynes outbuf[1] = MAX5821_EXTENDED_DAC_A; 9947298897SPhilippe Reynes else 10047298897SPhilippe Reynes outbuf[1] = MAX5821_EXTENDED_DAC_B; 10147298897SPhilippe Reynes 10247298897SPhilippe Reynes if (data->powerdown[chan->channel]) 10347298897SPhilippe Reynes outbuf[1] |= data->powerdown_mode[chan->channel] + 1; 10447298897SPhilippe Reynes else 10547298897SPhilippe Reynes outbuf[1] |= MAX5821_EXTENDED_POWER_UP; 10647298897SPhilippe Reynes 10747298897SPhilippe Reynes return i2c_master_send(data->client, outbuf, 2); 10847298897SPhilippe Reynes } 10947298897SPhilippe Reynes 11047298897SPhilippe Reynes static ssize_t max5821_write_dac_powerdown(struct iio_dev *indio_dev, 11147298897SPhilippe Reynes uintptr_t private, 11247298897SPhilippe Reynes const struct iio_chan_spec *chan, 11347298897SPhilippe Reynes const char *buf, size_t len) 11447298897SPhilippe Reynes { 11547298897SPhilippe Reynes struct max5821_data *data = iio_priv(indio_dev); 11647298897SPhilippe Reynes bool powerdown; 11747298897SPhilippe Reynes int ret; 11847298897SPhilippe Reynes 119*74f582ecSLars-Peter Clausen ret = kstrtobool(buf, &powerdown); 12047298897SPhilippe Reynes if (ret) 12147298897SPhilippe Reynes return ret; 12247298897SPhilippe Reynes 12347298897SPhilippe Reynes data->powerdown[chan->channel] = powerdown; 12447298897SPhilippe Reynes 12547298897SPhilippe Reynes ret = max5821_sync_powerdown_mode(data, chan); 12647298897SPhilippe Reynes if (ret < 0) 12747298897SPhilippe Reynes return ret; 12847298897SPhilippe Reynes 12947298897SPhilippe Reynes return len; 13047298897SPhilippe Reynes } 13147298897SPhilippe Reynes 13247298897SPhilippe Reynes static const struct iio_chan_spec_ext_info max5821_ext_info[] = { 13347298897SPhilippe Reynes { 13447298897SPhilippe Reynes .name = "powerdown", 13547298897SPhilippe Reynes .read = max5821_read_dac_powerdown, 13647298897SPhilippe Reynes .write = max5821_write_dac_powerdown, 13747298897SPhilippe Reynes .shared = IIO_SEPARATE, 13847298897SPhilippe Reynes }, 13947298897SPhilippe Reynes IIO_ENUM("powerdown_mode", IIO_SEPARATE, &max5821_powerdown_mode_enum), 140ffc7c517SAntoniu Miclaus IIO_ENUM_AVAILABLE("powerdown_mode", IIO_SHARED_BY_TYPE, &max5821_powerdown_mode_enum), 14147298897SPhilippe Reynes { }, 14247298897SPhilippe Reynes }; 14347298897SPhilippe Reynes 14447298897SPhilippe Reynes #define MAX5821_CHANNEL(chan) { \ 14547298897SPhilippe Reynes .type = IIO_VOLTAGE, \ 14647298897SPhilippe Reynes .indexed = 1, \ 14747298897SPhilippe Reynes .output = 1, \ 14847298897SPhilippe Reynes .channel = (chan), \ 14947298897SPhilippe Reynes .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ 15047298897SPhilippe Reynes .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SCALE), \ 15147298897SPhilippe Reynes .ext_info = max5821_ext_info, \ 15247298897SPhilippe Reynes } 15347298897SPhilippe Reynes 15447298897SPhilippe Reynes static const struct iio_chan_spec max5821_channels[] = { 15547298897SPhilippe Reynes MAX5821_CHANNEL(0), 15647298897SPhilippe Reynes MAX5821_CHANNEL(1) 15747298897SPhilippe Reynes }; 15847298897SPhilippe Reynes 15947298897SPhilippe Reynes static const u8 max5821_read_dac_command[] = { 16047298897SPhilippe Reynes MAX5821_READ_DAC_A_COMMAND, 16147298897SPhilippe Reynes MAX5821_READ_DAC_B_COMMAND 16247298897SPhilippe Reynes }; 16347298897SPhilippe Reynes 16447298897SPhilippe Reynes static const u8 max5821_load_dac_command[] = { 16547298897SPhilippe Reynes MAX5821_LOAD_DAC_A_IN_REG_B, 16647298897SPhilippe Reynes MAX5821_LOAD_DAC_B_IN_REG_A 16747298897SPhilippe Reynes }; 16847298897SPhilippe Reynes 16947298897SPhilippe Reynes static int max5821_get_value(struct iio_dev *indio_dev, 17047298897SPhilippe Reynes int *val, int channel) 17147298897SPhilippe Reynes { 17247298897SPhilippe Reynes struct max5821_data *data = iio_priv(indio_dev); 17347298897SPhilippe Reynes struct i2c_client *client = data->client; 17447298897SPhilippe Reynes u8 outbuf[1]; 17547298897SPhilippe Reynes u8 inbuf[2]; 17647298897SPhilippe Reynes int ret; 17747298897SPhilippe Reynes 17847298897SPhilippe Reynes if ((channel != 0) && (channel != 1)) 17947298897SPhilippe Reynes return -EINVAL; 18047298897SPhilippe Reynes 18147298897SPhilippe Reynes outbuf[0] = max5821_read_dac_command[channel]; 18247298897SPhilippe Reynes 18347298897SPhilippe Reynes mutex_lock(&data->lock); 18447298897SPhilippe Reynes 18547298897SPhilippe Reynes ret = i2c_master_send(client, outbuf, 1); 18647298897SPhilippe Reynes if (ret < 0) { 18747298897SPhilippe Reynes mutex_unlock(&data->lock); 18847298897SPhilippe Reynes return ret; 18947298897SPhilippe Reynes } else if (ret != 1) { 19047298897SPhilippe Reynes mutex_unlock(&data->lock); 19147298897SPhilippe Reynes return -EIO; 19247298897SPhilippe Reynes } 19347298897SPhilippe Reynes 19447298897SPhilippe Reynes ret = i2c_master_recv(client, inbuf, 2); 19547298897SPhilippe Reynes if (ret < 0) { 19647298897SPhilippe Reynes mutex_unlock(&data->lock); 19747298897SPhilippe Reynes return ret; 19847298897SPhilippe Reynes } else if (ret != 2) { 19947298897SPhilippe Reynes mutex_unlock(&data->lock); 20047298897SPhilippe Reynes return -EIO; 20147298897SPhilippe Reynes } 20247298897SPhilippe Reynes 20347298897SPhilippe Reynes mutex_unlock(&data->lock); 20447298897SPhilippe Reynes 20547298897SPhilippe Reynes *val = ((inbuf[0] & 0x0f) << 6) | (inbuf[1] >> 2); 20647298897SPhilippe Reynes 20747298897SPhilippe Reynes return IIO_VAL_INT; 20847298897SPhilippe Reynes } 20947298897SPhilippe Reynes 21047298897SPhilippe Reynes static int max5821_set_value(struct iio_dev *indio_dev, 21147298897SPhilippe Reynes int val, int channel) 21247298897SPhilippe Reynes { 21347298897SPhilippe Reynes struct max5821_data *data = iio_priv(indio_dev); 21447298897SPhilippe Reynes struct i2c_client *client = data->client; 21547298897SPhilippe Reynes u8 outbuf[2]; 21647298897SPhilippe Reynes int ret; 21747298897SPhilippe Reynes 21847298897SPhilippe Reynes if ((val < 0) || (val > 1023)) 21947298897SPhilippe Reynes return -EINVAL; 22047298897SPhilippe Reynes 22147298897SPhilippe Reynes if ((channel != 0) && (channel != 1)) 22247298897SPhilippe Reynes return -EINVAL; 22347298897SPhilippe Reynes 22447298897SPhilippe Reynes outbuf[0] = max5821_load_dac_command[channel]; 22547298897SPhilippe Reynes outbuf[0] |= val >> 6; 22647298897SPhilippe Reynes outbuf[1] = (val & 0x3f) << 2; 22747298897SPhilippe Reynes 22847298897SPhilippe Reynes ret = i2c_master_send(client, outbuf, 2); 22947298897SPhilippe Reynes if (ret < 0) 23047298897SPhilippe Reynes return ret; 23147298897SPhilippe Reynes else if (ret != 2) 23247298897SPhilippe Reynes return -EIO; 23347298897SPhilippe Reynes else 23447298897SPhilippe Reynes return 0; 23547298897SPhilippe Reynes } 23647298897SPhilippe Reynes 23747298897SPhilippe Reynes static int max5821_read_raw(struct iio_dev *indio_dev, 23847298897SPhilippe Reynes struct iio_chan_spec const *chan, 23947298897SPhilippe Reynes int *val, int *val2, long mask) 24047298897SPhilippe Reynes { 24147298897SPhilippe Reynes struct max5821_data *data = iio_priv(indio_dev); 24247298897SPhilippe Reynes 24347298897SPhilippe Reynes switch (mask) { 24447298897SPhilippe Reynes case IIO_CHAN_INFO_RAW: 24547298897SPhilippe Reynes return max5821_get_value(indio_dev, val, chan->channel); 24647298897SPhilippe Reynes case IIO_CHAN_INFO_SCALE: 24747298897SPhilippe Reynes *val = data->vref_mv; 24847298897SPhilippe Reynes *val2 = 10; 24947298897SPhilippe Reynes return IIO_VAL_FRACTIONAL_LOG2; 25047298897SPhilippe Reynes default: 25147298897SPhilippe Reynes return -EINVAL; 25247298897SPhilippe Reynes } 25347298897SPhilippe Reynes } 25447298897SPhilippe Reynes 25547298897SPhilippe Reynes static int max5821_write_raw(struct iio_dev *indio_dev, 25647298897SPhilippe Reynes struct iio_chan_spec const *chan, 25747298897SPhilippe Reynes int val, int val2, long mask) 25847298897SPhilippe Reynes { 25947298897SPhilippe Reynes if (val2 != 0) 26047298897SPhilippe Reynes return -EINVAL; 26147298897SPhilippe Reynes 26247298897SPhilippe Reynes switch (mask) { 26347298897SPhilippe Reynes case IIO_CHAN_INFO_RAW: 26447298897SPhilippe Reynes return max5821_set_value(indio_dev, val, chan->channel); 26547298897SPhilippe Reynes default: 26647298897SPhilippe Reynes return -EINVAL; 26747298897SPhilippe Reynes } 26847298897SPhilippe Reynes } 26947298897SPhilippe Reynes 270b6ec220cSMarcus Folkesson static int __maybe_unused max5821_suspend(struct device *dev) 27147298897SPhilippe Reynes { 27247298897SPhilippe Reynes u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE, 27347298897SPhilippe Reynes MAX5821_EXTENDED_DAC_A | 27447298897SPhilippe Reynes MAX5821_EXTENDED_DAC_B | 27547298897SPhilippe Reynes MAX5821_EXTENDED_POWER_DOWN_MODE2 }; 27647298897SPhilippe Reynes 27747298897SPhilippe Reynes return i2c_master_send(to_i2c_client(dev), outbuf, 2); 27847298897SPhilippe Reynes } 27947298897SPhilippe Reynes 280b6ec220cSMarcus Folkesson static int __maybe_unused max5821_resume(struct device *dev) 28147298897SPhilippe Reynes { 28247298897SPhilippe Reynes u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE, 28347298897SPhilippe Reynes MAX5821_EXTENDED_DAC_A | 28447298897SPhilippe Reynes MAX5821_EXTENDED_DAC_B | 28547298897SPhilippe Reynes MAX5821_EXTENDED_POWER_UP }; 28647298897SPhilippe Reynes 28747298897SPhilippe Reynes return i2c_master_send(to_i2c_client(dev), outbuf, 2); 28847298897SPhilippe Reynes } 28947298897SPhilippe Reynes 29047298897SPhilippe Reynes static SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, max5821_resume); 29147298897SPhilippe Reynes 29247298897SPhilippe Reynes static const struct iio_info max5821_info = { 29347298897SPhilippe Reynes .read_raw = max5821_read_raw, 29447298897SPhilippe Reynes .write_raw = max5821_write_raw, 29547298897SPhilippe Reynes }; 29647298897SPhilippe Reynes 2976a25893cSThéo Borém Fabris static void max5821_regulator_disable(void *reg) 2986a25893cSThéo Borém Fabris { 2996a25893cSThéo Borém Fabris regulator_disable(reg); 3006a25893cSThéo Borém Fabris } 3016a25893cSThéo Borém Fabris 30247298897SPhilippe Reynes static int max5821_probe(struct i2c_client *client, 30347298897SPhilippe Reynes const struct i2c_device_id *id) 30447298897SPhilippe Reynes { 30547298897SPhilippe Reynes struct max5821_data *data; 30647298897SPhilippe Reynes struct iio_dev *indio_dev; 30747298897SPhilippe Reynes u32 tmp; 30847298897SPhilippe Reynes int ret; 30947298897SPhilippe Reynes 31047298897SPhilippe Reynes indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); 31147298897SPhilippe Reynes if (!indio_dev) 31247298897SPhilippe Reynes return -ENOMEM; 31347298897SPhilippe Reynes data = iio_priv(indio_dev); 31447298897SPhilippe Reynes data->client = client; 31547298897SPhilippe Reynes mutex_init(&data->lock); 31647298897SPhilippe Reynes 31747298897SPhilippe Reynes /* max5821 start in powerdown mode 100Kohm to ground */ 31847298897SPhilippe Reynes for (tmp = 0; tmp < MAX5821_MAX_DAC_CHANNELS; tmp++) { 31947298897SPhilippe Reynes data->powerdown[tmp] = true; 32047298897SPhilippe Reynes data->powerdown_mode[tmp] = MAX5821_100KOHM_TO_GND; 32147298897SPhilippe Reynes } 32247298897SPhilippe Reynes 32347298897SPhilippe Reynes data->vref_reg = devm_regulator_get(&client->dev, "vref"); 324d5c1118fSCai Huoqing if (IS_ERR(data->vref_reg)) 325d5c1118fSCai Huoqing return dev_err_probe(&client->dev, PTR_ERR(data->vref_reg), 326d5c1118fSCai Huoqing "Failed to get vref regulator\n"); 32747298897SPhilippe Reynes 32847298897SPhilippe Reynes ret = regulator_enable(data->vref_reg); 32947298897SPhilippe Reynes if (ret) { 33047298897SPhilippe Reynes dev_err(&client->dev, 33147298897SPhilippe Reynes "Failed to enable vref regulator: %d\n", ret); 3326a25893cSThéo Borém Fabris return ret; 3336a25893cSThéo Borém Fabris } 3346a25893cSThéo Borém Fabris 3356a25893cSThéo Borém Fabris ret = devm_add_action_or_reset(&client->dev, max5821_regulator_disable, 3366a25893cSThéo Borém Fabris data->vref_reg); 3376a25893cSThéo Borém Fabris if (ret) { 3386a25893cSThéo Borém Fabris dev_err(&client->dev, 3396a25893cSThéo Borém Fabris "Failed to add action to managed regulator: %d\n", ret); 3406a25893cSThéo Borém Fabris return ret; 34147298897SPhilippe Reynes } 34247298897SPhilippe Reynes 34347298897SPhilippe Reynes ret = regulator_get_voltage(data->vref_reg); 34447298897SPhilippe Reynes if (ret < 0) { 34547298897SPhilippe Reynes dev_err(&client->dev, 34647298897SPhilippe Reynes "Failed to get voltage on regulator: %d\n", ret); 3476a25893cSThéo Borém Fabris return ret; 34847298897SPhilippe Reynes } 34947298897SPhilippe Reynes 35047298897SPhilippe Reynes data->vref_mv = ret / 1000; 35147298897SPhilippe Reynes 35247298897SPhilippe Reynes indio_dev->name = id->name; 35347298897SPhilippe Reynes indio_dev->num_channels = ARRAY_SIZE(max5821_channels); 35447298897SPhilippe Reynes indio_dev->channels = max5821_channels; 35547298897SPhilippe Reynes indio_dev->modes = INDIO_DIRECT_MODE; 35647298897SPhilippe Reynes indio_dev->info = &max5821_info; 35747298897SPhilippe Reynes 3586a25893cSThéo Borém Fabris return devm_iio_device_register(&client->dev, indio_dev); 35947298897SPhilippe Reynes } 36047298897SPhilippe Reynes 36147298897SPhilippe Reynes static const struct i2c_device_id max5821_id[] = { 36247298897SPhilippe Reynes { "max5821", ID_MAX5821 }, 36347298897SPhilippe Reynes { } 36447298897SPhilippe Reynes }; 36547298897SPhilippe Reynes MODULE_DEVICE_TABLE(i2c, max5821_id); 36647298897SPhilippe Reynes 36747298897SPhilippe Reynes static const struct of_device_id max5821_of_match[] = { 36847298897SPhilippe Reynes { .compatible = "maxim,max5821" }, 36947298897SPhilippe Reynes { } 37047298897SPhilippe Reynes }; 371e09f56f3SLuis de Bethencourt MODULE_DEVICE_TABLE(of, max5821_of_match); 37247298897SPhilippe Reynes 37347298897SPhilippe Reynes static struct i2c_driver max5821_driver = { 37447298897SPhilippe Reynes .driver = { 37547298897SPhilippe Reynes .name = "max5821", 37673733403SJavier Martinez Canillas .of_match_table = max5821_of_match, 377b6ec220cSMarcus Folkesson .pm = &max5821_pm_ops, 37847298897SPhilippe Reynes }, 37947298897SPhilippe Reynes .probe = max5821_probe, 38047298897SPhilippe Reynes .id_table = max5821_id, 38147298897SPhilippe Reynes }; 38247298897SPhilippe Reynes module_i2c_driver(max5821_driver); 38347298897SPhilippe Reynes 38447298897SPhilippe Reynes MODULE_AUTHOR("Philippe Reynes <tremyfr@yahoo.fr>"); 38547298897SPhilippe Reynes MODULE_DESCRIPTION("MAX5821 DAC"); 38647298897SPhilippe Reynes MODULE_LICENSE("GPL v2"); 387