Show
Ignore:
Timestamp:
08/19/07 17:04:29 (7 years ago)
Author:
khali
Message:

Support more bus types (part 2 of 2). Originally libsensors was very
i2c-centric. Make it more neutral so that we can cleanly support
additional bus types such as SPI or One-Wire.

This second part updates sensors_bus to use sensors_bus_id. Thanks
to Mark M. Hoffman for showing me how the configuration file
parser could be modified to support that change.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/lib/conf-parse.y

    r4465 r4687  
    9595  sensors_chip_name_list chips; 
    9696  sensors_expr *expr; 
    97   int bus; 
     97  sensors_bus_id bus; 
    9898  sensors_chip_name chip; 
    9999  int line; 
     
    119119%type <chips> chip_name_list 
    120120%type <expr> expression 
    121 %type <bus> i2cbus_name 
     121%type <bus> bus_id 
    122122%type <name> adapter_name 
    123123%type <name> function_name 
     
    142142; 
    143143 
    144 bus_statement:    BUS i2cbus_name adapter_name 
     144bus_statement:    BUS bus_id adapter_name 
    145145                  { sensors_bus new_el; 
    146146                    new_el.lineno = $1; 
    147                     new_el.number = $2; 
     147                    new_el.bus = $2; 
    148148                    new_el.adapter = $3; 
    149149                    bus_add_el(&new_el); 
     
    288288; 
    289289 
    290 i2cbus_name:      NAME 
    291                   { int res = sensors_parse_i2cbus_name($1,&$$); 
     290bus_id:           NAME 
     291                  { int res = sensors_parse_bus_id($1,&$$); 
    292292                    free($1); 
    293293                    if (res) { 
    294                       sensors_yyerror("Parse error in i2c bus name"); 
     294                      sensors_yyerror("Parse error in bus id"); 
    295295                      YYERROR; 
    296296                    }