x86.c: remove duplicate case statement
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -40,11 +40,11 @@ mraa_set_pininfo(mraa_board_t* board, int mraa_index, char *name, mraa_pincapabi
|
|||||||
{
|
{
|
||||||
if (mraa_index < board->phy_pin_count) {
|
if (mraa_index < board->phy_pin_count) {
|
||||||
// adjust mraa_index for ARCH_NR_GPIOS value
|
// adjust mraa_index for ARCH_NR_GPIOS value
|
||||||
mraa_pininfo_t* pin_info = &board->pins[(mraa_index)];
|
mraa_pininfo_t* pin_info = &board->pins[mraa_index];
|
||||||
strncpy(pin_info->name, name, 7);
|
strncpy(pin_info->name, name, 7);
|
||||||
pin_info->capabilites = caps;
|
pin_info->capabilites = caps;
|
||||||
if (caps.gpio)
|
if (caps.gpio)
|
||||||
pin_info->gpio.pinmap = sysfs_pin;
|
pin_info->gpio.pinmap = sysfs_pin | arch_nr_gpios_adjust;
|
||||||
if (caps.i2c) {
|
if (caps.i2c) {
|
||||||
pin_info->i2c.pinmap = 1;
|
pin_info->i2c.pinmap = 1;
|
||||||
pin_info->i2c.mux_total = 0;
|
pin_info->i2c.mux_total = 0;
|
||||||
|
|||||||
@@ -43,44 +43,31 @@ mraa_x86_platform()
|
|||||||
if (getline(&line, &len, fh) != -1) {
|
if (getline(&line, &len, fh) != -1) {
|
||||||
if (strncmp(line, "GalileoGen2", 11) == 0) {
|
if (strncmp(line, "GalileoGen2", 11) == 0) {
|
||||||
platform_type = MRAA_INTEL_GALILEO_GEN2;
|
platform_type = MRAA_INTEL_GALILEO_GEN2;
|
||||||
|
plat = mraa_intel_galileo_gen2();
|
||||||
} else if (strncmp(line, "BODEGA BAY", 10) == 0) {
|
} else if (strncmp(line, "BODEGA BAY", 10) == 0) {
|
||||||
platform_type = MRAA_INTEL_EDISON_FAB_C;
|
platform_type = MRAA_INTEL_EDISON_FAB_C;
|
||||||
|
plat = mraa_intel_edison_fab_c();
|
||||||
} else if (strncmp(line, "SALT BAY", 8) == 0) {
|
} else if (strncmp(line, "SALT BAY", 8) == 0) {
|
||||||
platform_type = MRAA_INTEL_EDISON_FAB_C;
|
platform_type = MRAA_INTEL_EDISON_FAB_C;
|
||||||
|
plat = mraa_intel_edison_fab_c();
|
||||||
} else if (strncmp(line, "DE3815", 6) == 0) {
|
} else if (strncmp(line, "DE3815", 6) == 0) {
|
||||||
platform_type = MRAA_INTEL_DE3815;
|
platform_type = MRAA_INTEL_DE3815;
|
||||||
|
plat = mraa_intel_de3815();
|
||||||
} else if (strncmp(line, "NOTEBOOK", 8) == 0) {
|
} else if (strncmp(line, "NOTEBOOK", 8) == 0) {
|
||||||
platform_type = MRAA_INTEL_MINNOWBOARD_MAX;
|
platform_type = MRAA_INTEL_MINNOWBOARD_MAX;
|
||||||
|
plat = mraa_intel_minnow_max();
|
||||||
} else if (strncasecmp(line, "MinnowBoard MAX", 15) == 0) {
|
} else if (strncasecmp(line, "MinnowBoard MAX", 15) == 0) {
|
||||||
platform_type = MRAA_INTEL_MINNOWBOARD_MAX;
|
platform_type = MRAA_INTEL_MINNOWBOARD_MAX;
|
||||||
|
plat = mraa_intel_minnow_max();
|
||||||
} else {
|
} else {
|
||||||
|
syslog(LOG_ERR, "Platform not supported, initialising as MRAA_INTEL_GALILEO_GEN1");
|
||||||
platform_type = MRAA_INTEL_GALILEO_GEN1;
|
platform_type = MRAA_INTEL_GALILEO_GEN1;
|
||||||
|
plat = mraa_intel_galileo_rev_d();
|
||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
fclose(fh);
|
fclose(fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(platform_type) {
|
|
||||||
case MRAA_INTEL_GALILEO_GEN2:
|
|
||||||
plat = mraa_intel_galileo_gen2();
|
|
||||||
break;
|
|
||||||
case MRAA_INTEL_GALILEO_GEN1:
|
|
||||||
plat = mraa_intel_galileo_rev_d();
|
|
||||||
break;
|
|
||||||
case MRAA_INTEL_EDISON_FAB_C:
|
|
||||||
plat = mraa_intel_edison_fab_c();
|
|
||||||
break;
|
|
||||||
case MRAA_INTEL_DE3815:
|
|
||||||
plat = mraa_intel_de3815();
|
|
||||||
break;
|
|
||||||
case MRAA_INTEL_MINNOWBOARD_MAX:
|
|
||||||
plat = mraa_intel_minnow_max();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
plat = mraa_intel_galileo_rev_d();
|
|
||||||
syslog(LOG_ERR, "Platform not supported, initialising as MRAA_INTEL_GALILEO_GEN1");
|
|
||||||
}
|
|
||||||
return platform_type;
|
return platform_type;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user