Commit 9f287a1c authored by Jeremy Fertic's avatar Jeremy Fertic Committed by Jonathan Cameron

staging: iio: adt7316: remove dac vref buffer bypass from adt751x

The option to allow the external vref to bypass the reference buffer is
only available for adt7316/7/8. Remove the attributes for adt751x as
well as the chip->id checks from the show and store functions.
Signed-off-by: default avatarJeremy Fertic <jeremyfertic@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 10bfe7cc
...@@ -969,9 +969,6 @@ static ssize_t adt7316_show_DA_AB_Vref_bypass(struct device *dev, ...@@ -969,9 +969,6 @@ static ssize_t adt7316_show_DA_AB_Vref_bypass(struct device *dev,
struct iio_dev *dev_info = dev_to_iio_dev(dev); struct iio_dev *dev_info = dev_to_iio_dev(dev);
struct adt7316_chip_info *chip = iio_priv(dev_info); struct adt7316_chip_info *chip = iio_priv(dev_info);
if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX)
return -EPERM;
return sprintf(buf, "%d\n", return sprintf(buf, "%d\n",
!!(chip->dac_config & ADT7316_VREF_BYPASS_DAC_AB)); !!(chip->dac_config & ADT7316_VREF_BYPASS_DAC_AB));
} }
...@@ -986,9 +983,6 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev, ...@@ -986,9 +983,6 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev,
u8 dac_config; u8 dac_config;
int ret; int ret;
if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX)
return -EPERM;
dac_config = chip->dac_config & (~ADT7316_VREF_BYPASS_DAC_AB); dac_config = chip->dac_config & (~ADT7316_VREF_BYPASS_DAC_AB);
if (buf[0] == '1') if (buf[0] == '1')
dac_config |= ADT7316_VREF_BYPASS_DAC_AB; dac_config |= ADT7316_VREF_BYPASS_DAC_AB;
...@@ -1014,9 +1008,6 @@ static ssize_t adt7316_show_DA_CD_Vref_bypass(struct device *dev, ...@@ -1014,9 +1008,6 @@ static ssize_t adt7316_show_DA_CD_Vref_bypass(struct device *dev,
struct iio_dev *dev_info = dev_to_iio_dev(dev); struct iio_dev *dev_info = dev_to_iio_dev(dev);
struct adt7316_chip_info *chip = iio_priv(dev_info); struct adt7316_chip_info *chip = iio_priv(dev_info);
if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX)
return -EPERM;
return sprintf(buf, "%d\n", return sprintf(buf, "%d\n",
!!(chip->dac_config & ADT7316_VREF_BYPASS_DAC_CD)); !!(chip->dac_config & ADT7316_VREF_BYPASS_DAC_CD));
} }
...@@ -1031,9 +1022,6 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev, ...@@ -1031,9 +1022,6 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev,
u8 dac_config; u8 dac_config;
int ret; int ret;
if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX)
return -EPERM;
dac_config = chip->dac_config & (~ADT7316_VREF_BYPASS_DAC_CD); dac_config = chip->dac_config & (~ADT7316_VREF_BYPASS_DAC_CD);
if (buf[0] == '1') if (buf[0] == '1')
dac_config |= ADT7316_VREF_BYPASS_DAC_CD; dac_config |= ADT7316_VREF_BYPASS_DAC_CD;
...@@ -1710,8 +1698,6 @@ static struct attribute *adt7516_attributes[] = { ...@@ -1710,8 +1698,6 @@ static struct attribute *adt7516_attributes[] = {
&iio_dev_attr_DAC_update_mode.dev_attr.attr, &iio_dev_attr_DAC_update_mode.dev_attr.attr,
&iio_dev_attr_all_DAC_update_modes.dev_attr.attr, &iio_dev_attr_all_DAC_update_modes.dev_attr.attr,
&iio_dev_attr_update_DAC.dev_attr.attr, &iio_dev_attr_update_DAC.dev_attr.attr,
&iio_dev_attr_DA_AB_Vref_bypass.dev_attr.attr,
&iio_dev_attr_DA_CD_Vref_bypass.dev_attr.attr,
&iio_dev_attr_DAC_internal_Vref.dev_attr.attr, &iio_dev_attr_DAC_internal_Vref.dev_attr.attr,
&iio_dev_attr_VDD.dev_attr.attr, &iio_dev_attr_VDD.dev_attr.attr,
&iio_dev_attr_in_temp.dev_attr.attr, &iio_dev_attr_in_temp.dev_attr.attr,
......
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