shark              82 drivers/media/radio/radio-shark.c 	struct shark_device *shark = tea->private_data;
shark              86 drivers/media/radio/radio-shark.c 	if (shark->last_val == val)
shark              89 drivers/media/radio/radio-shark.c 	memset(shark->transfer_buffer, 0, TB_LEN);
shark              90 drivers/media/radio/radio-shark.c 	shark->transfer_buffer[0] = 0xc0; /* Write shift register command */
shark              92 drivers/media/radio/radio-shark.c 		shark->transfer_buffer[i] |= (val >> (24 - i * 8)) & 0xff;
shark              94 drivers/media/radio/radio-shark.c 	res = usb_interrupt_msg(shark->usbdev,
shark              95 drivers/media/radio/radio-shark.c 				usb_sndintpipe(shark->usbdev, SHARK_OUT_EP),
shark              96 drivers/media/radio/radio-shark.c 				shark->transfer_buffer, TB_LEN,
shark              99 drivers/media/radio/radio-shark.c 		shark->last_val = val;
shark             101 drivers/media/radio/radio-shark.c 		v4l2_err(&shark->v4l2_dev, "set-freq error: %d\n", res);
shark             106 drivers/media/radio/radio-shark.c 	struct shark_device *shark = tea->private_data;
shark             110 drivers/media/radio/radio-shark.c 	memset(shark->transfer_buffer, 0, TB_LEN);
shark             111 drivers/media/radio/radio-shark.c 	shark->transfer_buffer[0] = 0x80;
shark             112 drivers/media/radio/radio-shark.c 	res = usb_interrupt_msg(shark->usbdev,
shark             113 drivers/media/radio/radio-shark.c 				usb_sndintpipe(shark->usbdev, SHARK_OUT_EP),
shark             114 drivers/media/radio/radio-shark.c 				shark->transfer_buffer, TB_LEN,
shark             117 drivers/media/radio/radio-shark.c 		v4l2_err(&shark->v4l2_dev, "request-status error: %d\n", res);
shark             118 drivers/media/radio/radio-shark.c 		return shark->last_val;
shark             121 drivers/media/radio/radio-shark.c 	res = usb_interrupt_msg(shark->usbdev,
shark             122 drivers/media/radio/radio-shark.c 				usb_rcvintpipe(shark->usbdev, SHARK_IN_EP),
shark             123 drivers/media/radio/radio-shark.c 				shark->transfer_buffer, TB_LEN,
shark             126 drivers/media/radio/radio-shark.c 		v4l2_err(&shark->v4l2_dev, "get-status error: %d\n", res);
shark             127 drivers/media/radio/radio-shark.c 		return shark->last_val;
shark             131 drivers/media/radio/radio-shark.c 		val |= shark->transfer_buffer[i] << (24 - i * 8);
shark             133 drivers/media/radio/radio-shark.c 	shark->last_val = val;
shark             142 drivers/media/radio/radio-shark.c 		shark->tea.stereo = true;
shark             144 drivers/media/radio/radio-shark.c 		shark->tea.stereo = false;
shark             157 drivers/media/radio/radio-shark.c 	struct shark_device *shark =
shark             162 drivers/media/radio/radio-shark.c 		if (!test_and_clear_bit(i, &shark->brightness_new))
shark             165 drivers/media/radio/radio-shark.c 		brightness = atomic_read(&shark->brightness[i]);
shark             166 drivers/media/radio/radio-shark.c 		memset(shark->transfer_buffer, 0, TB_LEN);
shark             168 drivers/media/radio/radio-shark.c 			shark->transfer_buffer[0] = 0xA0 + i;
shark             169 drivers/media/radio/radio-shark.c 			shark->transfer_buffer[1] = brightness;
shark             171 drivers/media/radio/radio-shark.c 			shark->transfer_buffer[0] = brightness ? 0xA9 : 0xA8;
shark             172 drivers/media/radio/radio-shark.c 		res = usb_interrupt_msg(shark->usbdev,
shark             173 drivers/media/radio/radio-shark.c 					usb_sndintpipe(shark->usbdev, 0x05),
shark             174 drivers/media/radio/radio-shark.c 					shark->transfer_buffer, TB_LEN,
shark             177 drivers/media/radio/radio-shark.c 			v4l2_err(&shark->v4l2_dev, "set LED %s error: %d\n",
shark             178 drivers/media/radio/radio-shark.c 				 shark->led_names[i], res);
shark             185 drivers/media/radio/radio-shark.c 	struct shark_device *shark =
shark             188 drivers/media/radio/radio-shark.c 	atomic_set(&shark->brightness[BLUE_LED], value);
shark             189 drivers/media/radio/radio-shark.c 	set_bit(BLUE_LED, &shark->brightness_new);
shark             190 drivers/media/radio/radio-shark.c 	clear_bit(BLUE_IS_PULSE, &shark->brightness_new);
shark             191 drivers/media/radio/radio-shark.c 	schedule_work(&shark->led_work);
shark             197 drivers/media/radio/radio-shark.c 	struct shark_device *shark = container_of(led_cdev,
shark             200 drivers/media/radio/radio-shark.c 	atomic_set(&shark->brightness[BLUE_PULSE_LED], 256 - value);
shark             201 drivers/media/radio/radio-shark.c 	set_bit(BLUE_PULSE_LED, &shark->brightness_new);
shark             202 drivers/media/radio/radio-shark.c 	set_bit(BLUE_IS_PULSE, &shark->brightness_new);
shark             203 drivers/media/radio/radio-shark.c 	schedule_work(&shark->led_work);
shark             209 drivers/media/radio/radio-shark.c 	struct shark_device *shark =
shark             212 drivers/media/radio/radio-shark.c 	atomic_set(&shark->brightness[RED_LED], value);
shark             213 drivers/media/radio/radio-shark.c 	set_bit(RED_LED, &shark->brightness_new);
shark             214 drivers/media/radio/radio-shark.c 	schedule_work(&shark->led_work);
shark             238 drivers/media/radio/radio-shark.c static int shark_register_leds(struct shark_device *shark, struct device *dev)
shark             242 drivers/media/radio/radio-shark.c 	atomic_set(&shark->brightness[BLUE_LED], 127);
shark             243 drivers/media/radio/radio-shark.c 	INIT_WORK(&shark->led_work, shark_led_work);
shark             245 drivers/media/radio/radio-shark.c 		shark->leds[i] = shark_led_templates[i];
shark             246 drivers/media/radio/radio-shark.c 		snprintf(shark->led_names[i], sizeof(shark->led_names[0]),
shark             247 drivers/media/radio/radio-shark.c 			 shark->leds[i].name, shark->v4l2_dev.name);
shark             248 drivers/media/radio/radio-shark.c 		shark->leds[i].name = shark->led_names[i];
shark             249 drivers/media/radio/radio-shark.c 		retval = led_classdev_register(dev, &shark->leds[i]);
shark             251 drivers/media/radio/radio-shark.c 			v4l2_err(&shark->v4l2_dev,
shark             253 drivers/media/radio/radio-shark.c 				 shark->led_names[i]);
shark             260 drivers/media/radio/radio-shark.c static void shark_unregister_leds(struct shark_device *shark)
shark             265 drivers/media/radio/radio-shark.c 		led_classdev_unregister(&shark->leds[i]);
shark             267 drivers/media/radio/radio-shark.c 	cancel_work_sync(&shark->led_work);
shark             270 drivers/media/radio/radio-shark.c static inline void shark_resume_leds(struct shark_device *shark)
shark             272 drivers/media/radio/radio-shark.c 	if (test_bit(BLUE_IS_PULSE, &shark->brightness_new))
shark             273 drivers/media/radio/radio-shark.c 		set_bit(BLUE_PULSE_LED, &shark->brightness_new);
shark             275 drivers/media/radio/radio-shark.c 		set_bit(BLUE_LED, &shark->brightness_new);
shark             276 drivers/media/radio/radio-shark.c 	set_bit(RED_LED, &shark->brightness_new);
shark             277 drivers/media/radio/radio-shark.c 	schedule_work(&shark->led_work);
shark             280 drivers/media/radio/radio-shark.c static int shark_register_leds(struct shark_device *shark, struct device *dev)
shark             282 drivers/media/radio/radio-shark.c 	v4l2_warn(&shark->v4l2_dev,
shark             286 drivers/media/radio/radio-shark.c static inline void shark_unregister_leds(struct shark_device *shark) { }
shark             287 drivers/media/radio/radio-shark.c static inline void shark_resume_leds(struct shark_device *shark) { }
shark             293 drivers/media/radio/radio-shark.c 	struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);
shark             295 drivers/media/radio/radio-shark.c 	mutex_lock(&shark->tea.mutex);
shark             296 drivers/media/radio/radio-shark.c 	v4l2_device_disconnect(&shark->v4l2_dev);
shark             297 drivers/media/radio/radio-shark.c 	snd_tea575x_exit(&shark->tea);
shark             298 drivers/media/radio/radio-shark.c 	mutex_unlock(&shark->tea.mutex);
shark             300 drivers/media/radio/radio-shark.c 	shark_unregister_leds(shark);
shark             302 drivers/media/radio/radio-shark.c 	v4l2_device_put(&shark->v4l2_dev);
shark             307 drivers/media/radio/radio-shark.c 	struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);
shark             309 drivers/media/radio/radio-shark.c 	v4l2_device_unregister(&shark->v4l2_dev);
shark             310 drivers/media/radio/radio-shark.c 	kfree(shark->transfer_buffer);
shark             311 drivers/media/radio/radio-shark.c 	kfree(shark);
shark             317 drivers/media/radio/radio-shark.c 	struct shark_device *shark;
shark             320 drivers/media/radio/radio-shark.c 	shark = kzalloc(sizeof(struct shark_device), GFP_KERNEL);
shark             321 drivers/media/radio/radio-shark.c 	if (!shark)
shark             324 drivers/media/radio/radio-shark.c 	shark->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL);
shark             325 drivers/media/radio/radio-shark.c 	if (!shark->transfer_buffer)
shark             328 drivers/media/radio/radio-shark.c 	v4l2_device_set_name(&shark->v4l2_dev, DRV_NAME, &shark_instance);
shark             330 drivers/media/radio/radio-shark.c 	retval = shark_register_leds(shark, &intf->dev);
shark             334 drivers/media/radio/radio-shark.c 	shark->v4l2_dev.release = usb_shark_release;
shark             335 drivers/media/radio/radio-shark.c 	retval = v4l2_device_register(&intf->dev, &shark->v4l2_dev);
shark             337 drivers/media/radio/radio-shark.c 		v4l2_err(&shark->v4l2_dev, "couldn't register v4l2_device\n");
shark             341 drivers/media/radio/radio-shark.c 	shark->usbdev = interface_to_usbdev(intf);
shark             342 drivers/media/radio/radio-shark.c 	shark->tea.v4l2_dev = &shark->v4l2_dev;
shark             343 drivers/media/radio/radio-shark.c 	shark->tea.private_data = shark;
shark             344 drivers/media/radio/radio-shark.c 	shark->tea.radio_nr = -1;
shark             345 drivers/media/radio/radio-shark.c 	shark->tea.ops = &shark_tea_ops;
shark             346 drivers/media/radio/radio-shark.c 	shark->tea.cannot_mute = true;
shark             347 drivers/media/radio/radio-shark.c 	shark->tea.has_am = true;
shark             348 drivers/media/radio/radio-shark.c 	strscpy(shark->tea.card, "Griffin radioSHARK",
shark             349 drivers/media/radio/radio-shark.c 		sizeof(shark->tea.card));
shark             350 drivers/media/radio/radio-shark.c 	usb_make_path(shark->usbdev, shark->tea.bus_info,
shark             351 drivers/media/radio/radio-shark.c 		sizeof(shark->tea.bus_info));
shark             353 drivers/media/radio/radio-shark.c 	retval = snd_tea575x_init(&shark->tea, THIS_MODULE);
shark             355 drivers/media/radio/radio-shark.c 		v4l2_err(&shark->v4l2_dev, "couldn't init tea5757\n");
shark             362 drivers/media/radio/radio-shark.c 	v4l2_device_unregister(&shark->v4l2_dev);
shark             364 drivers/media/radio/radio-shark.c 	shark_unregister_leds(shark);
shark             366 drivers/media/radio/radio-shark.c 	kfree(shark->transfer_buffer);
shark             368 drivers/media/radio/radio-shark.c 	kfree(shark);
shark             382 drivers/media/radio/radio-shark.c 	struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);
shark             384 drivers/media/radio/radio-shark.c 	mutex_lock(&shark->tea.mutex);
shark             385 drivers/media/radio/radio-shark.c 	snd_tea575x_set_freq(&shark->tea);
shark             386 drivers/media/radio/radio-shark.c 	mutex_unlock(&shark->tea.mutex);
shark             388 drivers/media/radio/radio-shark.c 	shark_resume_leds(shark);
shark              77 drivers/media/radio/radio-shark2.c 	struct shark_device *shark = tea->private_data;
shark              80 drivers/media/radio/radio-shark2.c 	memset(shark->transfer_buffer, 0, TB_LEN);
shark              81 drivers/media/radio/radio-shark2.c 	shark->transfer_buffer[0] = 0x81; /* Write register command */
shark              83 drivers/media/radio/radio-shark2.c 		shark->transfer_buffer[i + 1] = (reg >> (40 - i * 8)) & 0xff;
shark              86 drivers/media/radio/radio-shark2.c 		 7, shark->transfer_buffer);
shark              88 drivers/media/radio/radio-shark2.c 	res = usb_interrupt_msg(shark->usbdev,
shark              89 drivers/media/radio/radio-shark2.c 				usb_sndintpipe(shark->usbdev, SHARK_OUT_EP),
shark              90 drivers/media/radio/radio-shark2.c 				shark->transfer_buffer, TB_LEN,
shark             102 drivers/media/radio/radio-shark2.c 	struct shark_device *shark = tea->private_data;
shark             106 drivers/media/radio/radio-shark2.c 	memset(shark->transfer_buffer, 0, TB_LEN);
shark             107 drivers/media/radio/radio-shark2.c 	shark->transfer_buffer[0] = 0x82;
shark             108 drivers/media/radio/radio-shark2.c 	res = usb_interrupt_msg(shark->usbdev,
shark             109 drivers/media/radio/radio-shark2.c 				usb_sndintpipe(shark->usbdev, SHARK_OUT_EP),
shark             110 drivers/media/radio/radio-shark2.c 				shark->transfer_buffer, TB_LEN,
shark             117 drivers/media/radio/radio-shark2.c 	res = usb_interrupt_msg(shark->usbdev,
shark             118 drivers/media/radio/radio-shark2.c 				usb_rcvintpipe(shark->usbdev, SHARK_IN_EP),
shark             119 drivers/media/radio/radio-shark2.c 				shark->transfer_buffer, TB_LEN,
shark             127 drivers/media/radio/radio-shark2.c 		reg |= shark->transfer_buffer[i] << (16 - i * 8);
shark             130 drivers/media/radio/radio-shark2.c 		 3, shark->transfer_buffer);
shark             144 drivers/media/radio/radio-shark2.c 	struct shark_device *shark =
shark             149 drivers/media/radio/radio-shark2.c 		if (!test_and_clear_bit(i, &shark->brightness_new))
shark             152 drivers/media/radio/radio-shark2.c 		brightness = atomic_read(&shark->brightness[i]);
shark             153 drivers/media/radio/radio-shark2.c 		memset(shark->transfer_buffer, 0, TB_LEN);
shark             154 drivers/media/radio/radio-shark2.c 		shark->transfer_buffer[0] = 0x83 + i;
shark             155 drivers/media/radio/radio-shark2.c 		shark->transfer_buffer[1] = brightness;
shark             156 drivers/media/radio/radio-shark2.c 		res = usb_interrupt_msg(shark->usbdev,
shark             157 drivers/media/radio/radio-shark2.c 					usb_sndintpipe(shark->usbdev,
shark             159 drivers/media/radio/radio-shark2.c 					shark->transfer_buffer, TB_LEN,
shark             162 drivers/media/radio/radio-shark2.c 			v4l2_err(&shark->v4l2_dev, "set LED %s error: %d\n",
shark             163 drivers/media/radio/radio-shark2.c 				 shark->led_names[i], res);
shark             170 drivers/media/radio/radio-shark2.c 	struct shark_device *shark =
shark             173 drivers/media/radio/radio-shark2.c 	atomic_set(&shark->brightness[BLUE_LED], value);
shark             174 drivers/media/radio/radio-shark2.c 	set_bit(BLUE_LED, &shark->brightness_new);
shark             175 drivers/media/radio/radio-shark2.c 	schedule_work(&shark->led_work);
shark             181 drivers/media/radio/radio-shark2.c 	struct shark_device *shark =
shark             184 drivers/media/radio/radio-shark2.c 	atomic_set(&shark->brightness[RED_LED], value);
shark             185 drivers/media/radio/radio-shark2.c 	set_bit(RED_LED, &shark->brightness_new);
shark             186 drivers/media/radio/radio-shark2.c 	schedule_work(&shark->led_work);
shark             204 drivers/media/radio/radio-shark2.c static int shark_register_leds(struct shark_device *shark, struct device *dev)
shark             208 drivers/media/radio/radio-shark2.c 	atomic_set(&shark->brightness[BLUE_LED], 127);
shark             209 drivers/media/radio/radio-shark2.c 	INIT_WORK(&shark->led_work, shark_led_work);
shark             211 drivers/media/radio/radio-shark2.c 		shark->leds[i] = shark_led_templates[i];
shark             212 drivers/media/radio/radio-shark2.c 		snprintf(shark->led_names[i], sizeof(shark->led_names[0]),
shark             213 drivers/media/radio/radio-shark2.c 			 shark->leds[i].name, shark->v4l2_dev.name);
shark             214 drivers/media/radio/radio-shark2.c 		shark->leds[i].name = shark->led_names[i];
shark             215 drivers/media/radio/radio-shark2.c 		retval = led_classdev_register(dev, &shark->leds[i]);
shark             217 drivers/media/radio/radio-shark2.c 			v4l2_err(&shark->v4l2_dev,
shark             219 drivers/media/radio/radio-shark2.c 				 shark->led_names[i]);
shark             226 drivers/media/radio/radio-shark2.c static void shark_unregister_leds(struct shark_device *shark)
shark             231 drivers/media/radio/radio-shark2.c 		led_classdev_unregister(&shark->leds[i]);
shark             233 drivers/media/radio/radio-shark2.c 	cancel_work_sync(&shark->led_work);
shark             236 drivers/media/radio/radio-shark2.c static inline void shark_resume_leds(struct shark_device *shark)
shark             241 drivers/media/radio/radio-shark2.c 		set_bit(i, &shark->brightness_new);
shark             243 drivers/media/radio/radio-shark2.c 	schedule_work(&shark->led_work);
shark             246 drivers/media/radio/radio-shark2.c static int shark_register_leds(struct shark_device *shark, struct device *dev)
shark             248 drivers/media/radio/radio-shark2.c 	v4l2_warn(&shark->v4l2_dev,
shark             252 drivers/media/radio/radio-shark2.c static inline void shark_unregister_leds(struct shark_device *shark) { }
shark             253 drivers/media/radio/radio-shark2.c static inline void shark_resume_leds(struct shark_device *shark) { }
shark             259 drivers/media/radio/radio-shark2.c 	struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);
shark             261 drivers/media/radio/radio-shark2.c 	mutex_lock(&shark->tea.mutex);
shark             262 drivers/media/radio/radio-shark2.c 	v4l2_device_disconnect(&shark->v4l2_dev);
shark             263 drivers/media/radio/radio-shark2.c 	radio_tea5777_exit(&shark->tea);
shark             264 drivers/media/radio/radio-shark2.c 	mutex_unlock(&shark->tea.mutex);
shark             266 drivers/media/radio/radio-shark2.c 	shark_unregister_leds(shark);
shark             268 drivers/media/radio/radio-shark2.c 	v4l2_device_put(&shark->v4l2_dev);
shark             273 drivers/media/radio/radio-shark2.c 	struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);
shark             275 drivers/media/radio/radio-shark2.c 	v4l2_device_unregister(&shark->v4l2_dev);
shark             276 drivers/media/radio/radio-shark2.c 	kfree(shark->transfer_buffer);
shark             277 drivers/media/radio/radio-shark2.c 	kfree(shark);
shark             283 drivers/media/radio/radio-shark2.c 	struct shark_device *shark;
shark             286 drivers/media/radio/radio-shark2.c 	shark = kzalloc(sizeof(struct shark_device), GFP_KERNEL);
shark             287 drivers/media/radio/radio-shark2.c 	if (!shark)
shark             290 drivers/media/radio/radio-shark2.c 	shark->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL);
shark             291 drivers/media/radio/radio-shark2.c 	if (!shark->transfer_buffer)
shark             294 drivers/media/radio/radio-shark2.c 	v4l2_device_set_name(&shark->v4l2_dev, DRV_NAME, &shark_instance);
shark             296 drivers/media/radio/radio-shark2.c 	retval = shark_register_leds(shark, &intf->dev);
shark             300 drivers/media/radio/radio-shark2.c 	shark->v4l2_dev.release = usb_shark_release;
shark             301 drivers/media/radio/radio-shark2.c 	retval = v4l2_device_register(&intf->dev, &shark->v4l2_dev);
shark             303 drivers/media/radio/radio-shark2.c 		v4l2_err(&shark->v4l2_dev, "couldn't register v4l2_device\n");
shark             307 drivers/media/radio/radio-shark2.c 	shark->usbdev = interface_to_usbdev(intf);
shark             308 drivers/media/radio/radio-shark2.c 	shark->tea.v4l2_dev = &shark->v4l2_dev;
shark             309 drivers/media/radio/radio-shark2.c 	shark->tea.private_data = shark;
shark             310 drivers/media/radio/radio-shark2.c 	shark->tea.ops = &shark_tea_ops;
shark             311 drivers/media/radio/radio-shark2.c 	shark->tea.has_am = true;
shark             312 drivers/media/radio/radio-shark2.c 	shark->tea.write_before_read = true;
shark             313 drivers/media/radio/radio-shark2.c 	strscpy(shark->tea.card, "Griffin radioSHARK2",
shark             314 drivers/media/radio/radio-shark2.c 		sizeof(shark->tea.card));
shark             315 drivers/media/radio/radio-shark2.c 	usb_make_path(shark->usbdev, shark->tea.bus_info,
shark             316 drivers/media/radio/radio-shark2.c 		sizeof(shark->tea.bus_info));
shark             318 drivers/media/radio/radio-shark2.c 	retval = radio_tea5777_init(&shark->tea, THIS_MODULE);
shark             320 drivers/media/radio/radio-shark2.c 		v4l2_err(&shark->v4l2_dev, "couldn't init tea5777\n");
shark             327 drivers/media/radio/radio-shark2.c 	v4l2_device_unregister(&shark->v4l2_dev);
shark             329 drivers/media/radio/radio-shark2.c 	shark_unregister_leds(shark);
shark             331 drivers/media/radio/radio-shark2.c 	kfree(shark->transfer_buffer);
shark             333 drivers/media/radio/radio-shark2.c 	kfree(shark);
shark             347 drivers/media/radio/radio-shark2.c 	struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);
shark             350 drivers/media/radio/radio-shark2.c 	mutex_lock(&shark->tea.mutex);
shark             351 drivers/media/radio/radio-shark2.c 	ret = radio_tea5777_set_freq(&shark->tea);
shark             352 drivers/media/radio/radio-shark2.c 	mutex_unlock(&shark->tea.mutex);
shark             354 drivers/media/radio/radio-shark2.c 	shark_resume_leds(shark);