diff options
-rw-r--r-- | io-module/mts_io.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 318a9b7..e91bcb2 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -1349,8 +1349,8 @@ static ssize_t mts_attr_show_adc(struct device *dev, int offset; u32 value; - if (!strcmp(id_eeprom.hw_version, HW_VERSION_MTCDP_0_0)) { - log_debug("ADC not available on 0.0 hw"); + if (!DEVICE_CAPA(id_eeprom.capa, CAPA_ADC)) { + log_debug("ADC not available"); return -ENODEV; } @@ -1514,8 +1514,8 @@ static int __devinit mts_spi_dout_probe(struct spi_device *spi) { int tmp; - if (!strcmp(id_eeprom.hw_version, HW_VERSION_MTCDP_0_0)) { - log_debug("digital outputs not available on 0.0 hw"); + if (!DEVICE_CAPA(id_eeprom.capa, CAPA_DOUT)) { + log_debug("digital outputs not available"); return -ENODEV; } @@ -1558,8 +1558,8 @@ static int __devinit mts_spi_din_probe(struct spi_device *spi) { int tmp; - if (!strcmp(id_eeprom.hw_version, HW_VERSION_MTCDP_0_0)) { - log_debug("digital inputs not available on 0.0 hw"); + if (!DEVICE_CAPA(id_eeprom.capa, CAPA_DIN)) { + log_debug("digital inputs not available"); return -ENODEV; } @@ -1694,10 +1694,10 @@ static int __init mts_io_init(void) ADC_CONVERT_RESET(adc_base); writel(ADC_MODE_DEFAULT, adc_base + ADC_MR_OFFSET); writel(0x000F0F0F, adc_base + ADC_IDR_OFFSET); - if (!strcmp(id_eeprom.hw_version, HW_VERSION_MTCDP_0_0)) { - writel(0x0F, adc_base + ADC_CHDR_OFFSET); - } else { + if (DEVICE_CAPA(id_eeprom.capa, CAPA_ADC)) { writel(0x0F, adc_base + ADC_CHER_OFFSET); + } else { + writel(0x0F, adc_base + ADC_CHDR_OFFSET); } for (pin = gpio_pins; *pin->name; pin++) { |