/* * si470x_set_register - write register */ int si470x_set_register(struct si470x_device *radio, int regnr) { unsigned char buf[REGISTER_REPORT_SIZE]; int retval; buf[0] = REGISTER_REPORT(regnr); put_unaligned_be16(radio->registers[regnr], &buf[1]); retval = si470x_set_report(radio, (void *) &buf, sizeof(buf)); return (retval < 0) ? -EINVAL : 0; }
/* * si470x_set_led_state - sets the led state */ static int si470x_set_led_state(struct si470x_device *radio, unsigned char led_state) { int retval; radio->usb_buf[0] = LED_REPORT; radio->usb_buf[1] = LED_COMMAND; radio->usb_buf[2] = led_state; retval = si470x_set_report(radio, radio->usb_buf, LED_REPORT_SIZE); return (retval < 0) ? -EINVAL : 0; }
/* * si470x_set_led_state - sets the led state */ static int si470x_set_led_state(struct si470x_device *radio, unsigned char led_state) { unsigned char buf[LED_REPORT_SIZE]; int retval; buf[0] = LED_REPORT; buf[1] = LED_COMMAND; buf[2] = led_state; retval = si470x_set_report(radio, (void *) &buf, sizeof(buf)); return (retval < 0) ? -EINVAL : 0; }