// Module table
struct neuronspi_model_definition NEURONSPI_MODELTABLE[NEURONSPI_MODELTABLE_LEN] = {
- {.eeprom_length = 4, .eeprom_name = "S103", .name_length = 4, .model_name = "S103",
+ {.eeprom_length = 4, .eeprom_name = "S103", .name_length = 4, .model_name = "Neuron S103",
.combination_count = 1, .combinations = NEURONSPI_MODEL_S103_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "S103", .name_length = 6, .model_name = "S103-G",
+ {.eeprom_length = 4, .eeprom_name = "S103", .name_length = 6, .model_name = "Neuron S103-G",
.combination_count = 1, .combinations = NEURONSPI_MODEL_S103G_HW_DEFINITION_BOARD},
- {.eeprom_length = 6, .eeprom_name = "S103IQ", .name_length = 7, .model_name = "S103-IQ",
+ {.eeprom_length = 6, .eeprom_name = "S103IQ", .name_length = 7, .model_name = "Neuron S103-IQRF",
.combination_count = 1, .combinations = NEURONSPI_MODEL_S103IQ_HW_DEFINITION_BOARD},
- {.eeprom_length = 6, .eeprom_name = "S103EO", .name_length = 7, .model_name = "S103-EO",
+ {.eeprom_length = 6, .eeprom_name = "S103EO", .name_length = 7, .model_name = "Neuron HOUM Enocean S103",
.combination_count = 1, .combinations = NEURONSPI_MODEL_S103EO_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "M103", .name_length = 4, .model_name = "M103",
+ {.eeprom_length = 4, .eeprom_name = "M103", .name_length = 4, .model_name = "Neuron M103",
.combination_count = 2, .combinations = NEURONSPI_MODEL_M103_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "M203", .name_length = 4, .model_name = "M203",
+ {.eeprom_length = 4, .eeprom_name = "M203", .name_length = 4, .model_name = "Neuron M203",
.combination_count = 2, .combinations = NEURONSPI_MODEL_M203_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "M303", .name_length = 4, .model_name = "M303",
+ {.eeprom_length = 4, .eeprom_name = "M303", .name_length = 4, .model_name = "Neuron M303",
.combination_count = 2, .combinations = NEURONSPI_MODEL_M303_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "M403", .name_length = 4, .model_name = "M403",
+ {.eeprom_length = 4, .eeprom_name = "M403", .name_length = 4, .model_name = "Neuron M403",
.combination_count = 2, .combinations = NEURONSPI_MODEL_M403_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "M503", .name_length = 4, .model_name = "M503",
+ {.eeprom_length = 4, .eeprom_name = "M503", .name_length = 4, .model_name = "Neuron M503",
.combination_count = 2, .combinations = NEURONSPI_MODEL_M503_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "M603", .name_length = 4, .model_name = "M603",
+ {.eeprom_length = 4, .eeprom_name = "M603", .name_length = 4, .model_name = "Neuron M603",
.combination_count = 2, .combinations = NEURONSPI_MODEL_M603_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "L203", .name_length = 4, .model_name = "L203",
+ {.eeprom_length = 4, .eeprom_name = "L203", .name_length = 4, .model_name = "Neuron L203",
.combination_count = 3, .combinations = NEURONSPI_MODEL_L203_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "L303", .name_length = 4, .model_name = "L303",
+ {.eeprom_length = 4, .eeprom_name = "L303", .name_length = 4, .model_name = "Neuron L303",
.combination_count = 3, .combinations = NEURONSPI_MODEL_L303_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "L403", .name_length = 4, .model_name = "L403",
+ {.eeprom_length = 4, .eeprom_name = "L403", .name_length = 4, .model_name = "Neuron L403",
.combination_count = 3, .combinations = NEURONSPI_MODEL_L403_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "L503", .name_length = 4, .model_name = "L503",
+ {.eeprom_length = 4, .eeprom_name = "L503", .name_length = 4, .model_name = "Neuron L503",
.combination_count = 3, .combinations = NEURONSPI_MODEL_L503_HW_DEFINITION_BOARD},
- {.eeprom_length = 4, .eeprom_name = "L513", .name_length = 4, .model_name = "L513",
+ {.eeprom_length = 4, .eeprom_name = "L513", .name_length = 4, .model_name = "Neuron L513",
.combination_count = 3, .combinations = NEURONSPI_MODEL_L513_HW_DEFINITION_BOARD}
};
struct neuronspi_driver_data *n_spi = spi_get_drvdata(spi);
u8 *inp_buf;
u8 *outp_buf;
- int write_length;
+ int write_length, i;
write_length = neuronspi_spi_compose_single_register_read(reg, &inp_buf, &outp_buf);
- neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1);
+ if (neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1)) {
+ for (i = 0; i < write_length; i++) {
+ outp_buf[i] = 0;
+ }
+ }
memcpy(val, &outp_buf[NEURONSPI_HEADER_LENGTH], sizeof(u16));
kfree(inp_buf);
kfree(outp_buf);
struct neuronspi_driver_data *n_spi = spi_get_drvdata(spi);
u8 *inp_buf;
u8 *outp_buf;
- int write_length;
+ int write_length, i;
write_length = neuronspi_spi_compose_single_register_write(reg, &inp_buf, &outp_buf, (val >> 8));
- neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1);
+ if (neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1)) {
+ for (i = 0; i < write_length; i++) {
+ outp_buf[i] = 0;
+ }
+ }
memcpy(&val, &outp_buf[NEURONSPI_HEADER_LENGTH], sizeof(u16));
kfree(inp_buf);
kfree(outp_buf);
struct neuronspi_driver_data *n_spi;
u8 *inp_buf;
u8 *outp_buf;
- int i, write_length;
+ int i, j, write_length;
int block_counter = 0;
if (context == NULL) {
return 0;
// Check for continuity and read the largest possible continuous block
if (block_counter == ((reg_size / 2) - 1) || ((mb_reg_buf[i] + 1) != mb_reg_buf[i + 1])) {
write_length = neuronspi_spi_compose_multiple_register_read(block_counter + 1, mb_reg_buf[i - block_counter], &inp_buf, &outp_buf);
- neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 125, 1);
+ if (neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 125, 1)) {
+ for (j = 0; j < write_length; j++) {
+ outp_buf[j] = 0;
+ }
+ }
memcpy(&mb_val_buf[i - block_counter], &outp_buf[NEURONSPI_HEADER_LENGTH], (block_counter + 1) * 2);
kfree(inp_buf);
kfree(outp_buf);