summaryrefslogtreecommitdiff
path: root/io-module
diff options
context:
space:
mode:
authorJames Maki <jmaki@multitech.com>2010-09-09 16:39:20 -0500
committerJames Maki <jmaki@multitech.com>2010-09-09 16:39:20 -0500
commitd91650c87d5cf593087e9b14bf7ce7dda63b8fe3 (patch)
treeb8a74ea4de81c85bfc99cd4f45f77a99168365fc /io-module
parent5f3cb79dab7939c27b77c427c5f1e333f9e857ce (diff)
downloadmts-io-d91650c87d5cf593087e9b14bf7ce7dda63b8fe3.tar.gz
mts-io-d91650c87d5cf593087e9b14bf7ce7dda63b8fe3.tar.bz2
mts-io-d91650c87d5cf593087e9b14bf7ce7dda63b8fe3.zip
check the capabilities array instead of checking against the hw_version
Diffstat (limited to 'io-module')
-rw-r--r--io-module/mts_io.c18
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++) {