Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d1a51db authored by Thierry Reding's avatar Thierry Reding Committed by Mauro Carvalho Chehab
Browse files

[media] tm6000: Miscellaneous cleanups



This commit fixes a number of coding style issues as well as some issues
reported by checkpatch and sparse.

Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fd34cb08
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -397,7 +397,7 @@ static struct snd_pcm_ops snd_tm6000_pcm_ops = {
/*
/*
 * Alsa Constructor - Component probe
 * Alsa Constructor - Component probe
 */
 */
int tm6000_audio_init(struct tm6000_core *dev)
static int tm6000_audio_init(struct tm6000_core *dev)
{
{
	struct snd_card		*card;
	struct snd_card		*card;
	struct snd_tm6000_card	*chip;
	struct snd_tm6000_card	*chip;
@@ -490,7 +490,7 @@ static int tm6000_audio_fini(struct tm6000_core *dev)
	return 0;
	return 0;
}
}


struct tm6000_ops audio_ops = {
static struct tm6000_ops audio_ops = {
	.type	= TM6000_AUDIO,
	.type	= TM6000_AUDIO,
	.name	= "TM6000 Audio Extension",
	.name	= "TM6000 Audio Extension",
	.init	= tm6000_audio_init,
	.init	= tm6000_audio_init,
+8 −10
Original line number Original line Diff line number Diff line
@@ -87,7 +87,7 @@ struct tm6000_board {
	char		*ir_codes;
	char		*ir_codes;
};
};


struct tm6000_board tm6000_boards[] = {
static struct tm6000_board tm6000_boards[] = {
	[TM6000_BOARD_UNKNOWN] = {
	[TM6000_BOARD_UNKNOWN] = {
		.name         = "Unknown tm6000 video grabber",
		.name         = "Unknown tm6000 video grabber",
		.caps = {
		.caps = {
@@ -394,7 +394,7 @@ struct tm6000_board tm6000_boards[] = {
			.has_zl10353    = 1,
			.has_zl10353    = 1,
			.has_eeprom     = 1,
			.has_eeprom     = 1,
			.has_remote     = 1,
			.has_remote     = 1,
			.has_radio	= 1.
			.has_radio	= 1,
		},
		},
		.gpio = {
		.gpio = {
			.tuner_reset	= TM6010_GPIO_0,
			.tuner_reset	= TM6010_GPIO_0,
@@ -611,7 +611,7 @@ struct tm6000_board tm6000_boards[] = {
};
};


/* table of devices that work with this driver */
/* table of devices that work with this driver */
struct usb_device_id tm6000_id_table[] = {
static struct usb_device_id tm6000_id_table[] = {
	{ USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_GENERIC },
	{ USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_GENERIC },
	{ USB_DEVICE(0x6000, 0x0002), .driver_info = TM6010_BOARD_GENERIC },
	{ USB_DEVICE(0x6000, 0x0002), .driver_info = TM6010_BOARD_GENERIC },
	{ USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV },
	{ USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV },
@@ -632,7 +632,7 @@ struct usb_device_id tm6000_id_table[] = {
	{ USB_DEVICE(0x13d3, 0x3264), .driver_info = TM6010_BOARD_TWINHAN_TU501 },
	{ USB_DEVICE(0x13d3, 0x3264), .driver_info = TM6010_BOARD_TWINHAN_TU501 },
	{ USB_DEVICE(0x6000, 0xdec2), .driver_info = TM6010_BOARD_BEHOLD_WANDER_LITE },
	{ USB_DEVICE(0x6000, 0xdec2), .driver_info = TM6010_BOARD_BEHOLD_WANDER_LITE },
	{ USB_DEVICE(0x6000, 0xdec3), .driver_info = TM6010_BOARD_BEHOLD_VOYAGER_LITE },
	{ USB_DEVICE(0x6000, 0xdec3), .driver_info = TM6010_BOARD_BEHOLD_VOYAGER_LITE },
	{ },
	{ }
};
};


/* Control power led for show some activity */
/* Control power led for show some activity */
@@ -787,8 +787,6 @@ EXPORT_SYMBOL_GPL(tm6000_tuner_callback);


int tm6000_cards_setup(struct tm6000_core *dev)
int tm6000_cards_setup(struct tm6000_core *dev)
{
{
	int i, rc;

	/*
	/*
	 * Board-specific initialization sequence. Handles all GPIO
	 * Board-specific initialization sequence. Handles all GPIO
	 * initialization sequences that are board-specific.
	 * initialization sequences that are board-specific.
@@ -860,6 +858,9 @@ int tm6000_cards_setup(struct tm6000_core *dev)
	 */
	 */


	if (dev->gpio.tuner_reset) {
	if (dev->gpio.tuner_reset) {
		int rc;
		int i;

		for (i = 0; i < 2; i++) {
		for (i = 0; i < 2; i++) {
			rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
			rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
						dev->gpio.tuner_reset, 0x00);
						dev->gpio.tuner_reset, 0x00);
@@ -1168,7 +1169,7 @@ static int tm6000_usb_probe(struct usb_interface *interface,
	snprintf(dev->name, 29, "tm6000 #%d", nr);
	snprintf(dev->name, 29, "tm6000 #%d", nr);


	dev->model = id->driver_info;
	dev->model = id->driver_info;
	if ((card[nr] >= 0) && (card[nr] < ARRAY_SIZE(tm6000_boards)))
	if (card[nr] < ARRAY_SIZE(tm6000_boards))
		dev->model = card[nr];
		dev->model = card[nr];


	dev->udev = usbdev;
	dev->udev = usbdev;
@@ -1189,8 +1190,6 @@ static int tm6000_usb_probe(struct usb_interface *interface,
		speed = "unknown";
		speed = "unknown";
	}
	}




	/* Get endpoints */
	/* Get endpoints */
	for (i = 0; i < interface->num_altsetting; i++) {
	for (i = 0; i < interface->num_altsetting; i++) {
		int ep;
		int ep;
@@ -1274,7 +1273,6 @@ static int tm6000_usb_probe(struct usb_interface *interface,
	printk(KERN_INFO "tm6000: Found %s\n", tm6000_boards[dev->model].name);
	printk(KERN_INFO "tm6000: Found %s\n", tm6000_boards[dev->model].name);


	rc = tm6000_init_dev(dev);
	rc = tm6000_init_dev(dev);

	if (rc < 0)
	if (rc < 0)
		goto err;
		goto err;


+8 −9
Original line number Original line Diff line number Diff line
@@ -42,7 +42,6 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
	if (len)
	if (len)
		data = kzalloc(len, GFP_KERNEL);
		data = kzalloc(len, GFP_KERNEL);



	if (req_type & USB_DIR_IN)
	if (req_type & USB_DIR_IN)
		pipe = usb_rcvctrlpipe(dev->udev, 0);
		pipe = usb_rcvctrlpipe(dev->udev, 0);
	else {
	else {
@@ -390,7 +389,7 @@ struct reg_init {
};
};


/* The meaning of those initializations are unknown */
/* The meaning of those initializations are unknown */
struct reg_init tm6000_init_tab[] = {
static struct reg_init tm6000_init_tab[] = {
	/* REG  VALUE */
	/* REG  VALUE */
	{ TM6000_REQ07_RDF_PWDOWN_ACLK, 0x1f },
	{ TM6000_REQ07_RDF_PWDOWN_ACLK, 0x1f },
	{ TM6010_REQ07_RFF_SOFT_RESET, 0x08 },
	{ TM6010_REQ07_RFF_SOFT_RESET, 0x08 },
@@ -458,7 +457,7 @@ struct reg_init tm6000_init_tab[] = {
	{ TM6010_REQ05_R18_IMASK7, 0x00 },
	{ TM6010_REQ05_R18_IMASK7, 0x00 },
};
};


struct reg_init tm6010_init_tab[] = {
static struct reg_init tm6010_init_tab[] = {
	{ TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x00 },
	{ TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x00 },
	{ TM6010_REQ07_RC4_HSTART0, 0xa0 },
	{ TM6010_REQ07_RC4_HSTART0, 0xa0 },
	{ TM6010_REQ07_RC6_HEND0, 0x40 },
	{ TM6010_REQ07_RC6_HEND0, 0x40 },
@@ -687,7 +686,7 @@ int tm6000_set_audio_rinput(struct tm6000_core *dev)
	return 0;
	return 0;
}
}


void tm6010_set_mute_sif(struct tm6000_core *dev, u8 mute)
static void tm6010_set_mute_sif(struct tm6000_core *dev, u8 mute)
{
{
	u8 mute_reg = 0;
	u8 mute_reg = 0;


@@ -697,7 +696,7 @@ void tm6010_set_mute_sif(struct tm6000_core *dev, u8 mute)
	tm6000_set_reg_mask(dev, TM6010_REQ08_R0A_A_I2S_MOD, mute_reg, 0x08);
	tm6000_set_reg_mask(dev, TM6010_REQ08_R0A_A_I2S_MOD, mute_reg, 0x08);
}
}


void tm6010_set_mute_adc(struct tm6000_core *dev, u8 mute)
static void tm6010_set_mute_adc(struct tm6000_core *dev, u8 mute)
{
{
	u8 mute_reg = 0;
	u8 mute_reg = 0;


@@ -749,7 +748,7 @@ int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 mute)
	return 0;
	return 0;
}
}


void tm6010_set_volume_sif(struct tm6000_core *dev, int vol)
static void tm6010_set_volume_sif(struct tm6000_core *dev, int vol)
{
{
	u8 vol_reg;
	u8 vol_reg;


@@ -762,7 +761,7 @@ void tm6010_set_volume_sif(struct tm6000_core *dev, int vol)
	tm6000_set_reg(dev, TM6010_REQ08_R08_A_RIGHT_VOL, vol_reg);
	tm6000_set_reg(dev, TM6010_REQ08_R08_A_RIGHT_VOL, vol_reg);
}
}


void tm6010_set_volume_adc(struct tm6000_core *dev, int vol)
static void tm6010_set_volume_adc(struct tm6000_core *dev, int vol)
{
{
	u8 vol_reg;
	u8 vol_reg;


+7 −7
Original line number Original line Diff line number Diff line
@@ -105,7 +105,7 @@ static void tm6000_urb_received(struct urb *urb)
	}
	}
}
}


int tm6000_start_stream(struct tm6000_core *dev)
static int tm6000_start_stream(struct tm6000_core *dev)
{
{
	int ret;
	int ret;
	unsigned int pipe, size;
	unsigned int pipe, size;
@@ -166,7 +166,7 @@ int tm6000_start_stream(struct tm6000_core *dev)
	return 0;
	return 0;
}
}


void tm6000_stop_stream(struct tm6000_core *dev)
static void tm6000_stop_stream(struct tm6000_core *dev)
{
{
	struct tm6000_dvb *dvb = dev->dvb;
	struct tm6000_dvb *dvb = dev->dvb;


@@ -180,7 +180,7 @@ void tm6000_stop_stream(struct tm6000_core *dev)
	}
	}
}
}


int tm6000_start_feed(struct dvb_demux_feed *feed)
static int tm6000_start_feed(struct dvb_demux_feed *feed)
{
{
	struct dvb_demux *demux = feed->demux;
	struct dvb_demux *demux = feed->demux;
	struct tm6000_core *dev = demux->priv;
	struct tm6000_core *dev = demux->priv;
@@ -199,7 +199,7 @@ int tm6000_start_feed(struct dvb_demux_feed *feed)
	return 0;
	return 0;
}
}


int tm6000_stop_feed(struct dvb_demux_feed *feed)
static int tm6000_stop_feed(struct dvb_demux_feed *feed)
{
{
	struct dvb_demux *demux = feed->demux;
	struct dvb_demux *demux = feed->demux;
	struct tm6000_core *dev = demux->priv;
	struct tm6000_core *dev = demux->priv;
@@ -222,7 +222,7 @@ int tm6000_stop_feed(struct dvb_demux_feed *feed)
	return 0;
	return 0;
}
}


int tm6000_dvb_attach_frontend(struct tm6000_core *dev)
static int tm6000_dvb_attach_frontend(struct tm6000_core *dev)
{
{
	struct tm6000_dvb *dvb = dev->dvb;
	struct tm6000_dvb *dvb = dev->dvb;


@@ -247,7 +247,7 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev)


DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);


int register_dvb(struct tm6000_core *dev)
static int register_dvb(struct tm6000_core *dev)
{
{
	int ret = -1;
	int ret = -1;
	struct tm6000_dvb *dvb = dev->dvb;
	struct tm6000_dvb *dvb = dev->dvb;
@@ -359,7 +359,7 @@ int register_dvb(struct tm6000_core *dev)
	return ret;
	return ret;
}
}


void unregister_dvb(struct tm6000_core *dev)
static void unregister_dvb(struct tm6000_core *dev)
{
{
	struct tm6000_dvb *dvb = dev->dvb;
	struct tm6000_dvb *dvb = dev->dvb;


+1 −1
Original line number Original line Diff line number Diff line
@@ -284,7 +284,7 @@ static void tm6000_ir_stop(struct rc_dev *rc)
	cancel_delayed_work_sync(&ir->work);
	cancel_delayed_work_sync(&ir->work);
}
}


int tm6000_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
static int tm6000_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
{
{
	struct tm6000_IR *ir = rc->priv;
	struct tm6000_IR *ir = rc->priv;


Loading