From e5b35420ef7e6dc92a6cc5914bc9e5e5c1d48819 Mon Sep 17 00:00:00 2001 From: Fengguang Wu Date: Sun, 29 Jul 2012 19:39:09 +0800 Subject: ALSA: es1688 - freeup resources on init failure This will fix the following oops: [ 6.169981] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688) [ 6.170851] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14 [ 6.170851] Call Trace: [ 6.170851] [] ? __setup_irq+0x3c7/0x420 [ 6.170851] [] ? request_threaded_irq+0x76/0x140 [ 6.170851] [] ? snd_es1688_ioctl+0x10/0x10 [ 6.170851] [] ? request_threaded_irq+0xb2/0x140 [ 6.170851] [] ? snd_es1688_create+0x96/0x330 [ 6.170851] [] ? snd_gusextreme_probe+0x18d/0x5a2 [ 6.170851] [] ? __driver_attach+0x80/0x80 [ 6.170851] [] ? sysfs_create_link+0xf/0x20 [ 6.170851] [] ? __driver_attach+0x80/0x80 [ 6.170851] [] ? isa_bus_probe+0x12/0x20 [ 6.170851] [] ? driver_probe_device+0x55/0x1c0 [ 6.170851] [] ? _raw_spin_unlock+0xf/0x30 [ 6.170851] [] ? klist_next+0x6a/0xe0 [ 6.170851] [] ? isa_bus_match+0x21/0x40 [ 6.170851] [] ? bus_for_each_drv+0x34/0x70 [ 6.170851] [] ? device_attach+0x7b/0x90 [ 6.170851] [] ? __driver_attach+0x80/0x80 [ 6.170851] [] ? bus_probe_device+0x5f/0x80 [ 6.170851] [] ? device_add+0x573/0x620 [ 6.170851] [] ? complete_all+0x40/0x60 [ 6.170851] [] ? _raw_spin_unlock_irqrestore+0x1a/0x30 [ 6.170851] [] ? isa_register_driver+0xb6/0x150 [ 6.170851] [] ? alsa_card_gusmax_init+0xf/0xf [ 6.170851] [] ? do_one_initcall+0x7f/0x12b [ 6.170851] [] ? kernel_init+0x112/0x1a9 [ 6.170851] [] ? do_early_param+0x77/0x77 [ 6.170851] [] ? do_one_initcall+0x12b/0x12b [ 6.170851] [] ? kernel_thread_helper+0x6/0xd [ 6.190170] es1688: can't grab IRQ 5 [ 6.190613] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688) [ 6.191566] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14 [ 6.192394] Call Trace: [ 6.192685] [] ? __setup_irq+0x3c7/0x420 [ 6.193342] [] ? request_threaded_irq+0x76/0x140 [ 6.194081] [] ? snd_es1688_ioctl+0x10/0x10 [ 6.194607] [] ? request_threaded_irq+0xb2/0x140 [ 6.194607] [] ? snd_es1688_create+0x96/0x330 [ 6.194607] [] ? snd_gusextreme_probe+0x18d/0x5a2 [ 6.194607] [] ? __driver_attach+0x80/0x80 [ 6.194607] [] ? sysfs_create_link+0xf/0x20 [ 6.194607] [] ? __driver_attach+0x80/0x80 [ 6.194607] [] ? isa_bus_probe+0x12/0x20 [ 6.194607] [] ? driver_probe_device+0x55/0x1c0 [ 6.194607] [] ? _raw_spin_unlock+0xf/0x30 [ 6.194607] [] ? klist_next+0x6a/0xe0 [ 6.194607] [] ? isa_bus_match+0x21/0x40 [ 6.194607] [] ? bus_for_each_drv+0x34/0x70 [ 6.194607] [] ? device_attach+0x7b/0x90 [ 6.194607] [] ? __driver_attach+0x80/0x80 [ 6.194607] [] ? bus_probe_device+0x5f/0x80 [ 6.194607] [] ? device_add+0x573/0x620 [ 6.194607] [] ? complete_all+0x40/0x60 [ 6.194607] [] ? _raw_spin_unlock_irqrestore+0x1a/0x30 [ 6.194607] [] ? isa_register_driver+0xb6/0x150 [ 6.194607] [] ? alsa_card_gusmax_init+0xf/0xf [ 6.194607] [] ? do_one_initcall+0x7f/0x12b [ 6.194607] [] ? kernel_init+0x112/0x1a9 [ 6.194607] [] ? do_early_param+0x77/0x77 [ 6.194607] [] ? do_one_initcall+0x12b/0x12b [ 6.194607] [] ? kernel_thread_helper+0x6/0xd [ 6.210779] es1688: can't grab IRQ 5 [ 6.211305] gusextreme: probe of gusextreme.0 failed with error -16 Signed-off-by: Daniel Mack Signed-off-by: Fengguang Wu Signed-off-by: Takashi Iwai --- include/sound/es1688.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound') diff --git a/include/sound/es1688.h b/include/sound/es1688.h index 3ec7ecbe2502..f752dd33dfaf 100644 --- a/include/sound/es1688.h +++ b/include/sound/es1688.h @@ -29,6 +29,7 @@ #define ES1688_HW_AUTO 0x0000 #define ES1688_HW_688 0x0001 #define ES1688_HW_1688 0x0002 +#define ES1688_HW_UNDEF 0x0003 struct snd_es1688 { unsigned long port; /* port of ESS chip */ -- cgit v1.2.3 From 31a62d415726d94bae5caf5f2e50232aa06babf6 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 18 May 2012 09:36:17 -0300 Subject: [media] snd_tea575x: Add write_/read_val operations Some devices which use the tea575x tuner chip don't allow bit banging the lines, instead they offer a method to directly set / get the contents of the 25 bit shift-register in the chip. Notably the Griffin radioSHARK USB radio receiver does this. Signed-off-by: Hans de Goede CC: Ondrej Zary Signed-off-by: Mauro Carvalho Chehab --- include/sound/tea575x-tuner.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 0c3c2fb0f939..7bd6f6145a38 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -37,6 +37,10 @@ struct snd_tea575x; struct snd_tea575x_ops { + /* Drivers using snd_tea575x must either define read_ and write_val */ + void (*write_val)(struct snd_tea575x *tea, u32 val); + u32 (*read_val)(struct snd_tea575x *tea); + /* Or define the 3 pin functions */ void (*set_pins)(struct snd_tea575x *tea, u8 pins); u8 (*get_pins)(struct snd_tea575x *tea); void (*set_direction)(struct snd_tea575x *tea, bool output); -- cgit v1.2.3 From 3d0fe51cfa3d07751224c034f8226136a7dd05f2 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 18 May 2012 12:21:57 -0300 Subject: [media] snd_tea575x: Add a cannot_mute flag Some devices which use the tea575x tuner chip don't allow direct control over the IO pins, and thus cannot mute the audio output. Signed-off-by: Hans de Goede CC: Ondrej Zary Signed-off-by: Mauro Carvalho Chehab --- include/sound/tea575x-tuner.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 7bd6f6145a38..fe8590cac5c2 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -53,6 +53,7 @@ struct snd_tea575x { int radio_nr; /* radio_nr */ bool tea5759; /* 5759 chip is present */ bool cannot_read_data; /* Device cannot read the data pin */ + bool cannot_mute; /* Device cannot mute */ bool mute; /* Device is muted? */ bool stereo; /* receiving stereo */ bool tuned; /* tuned to a station */ -- cgit v1.2.3