diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-05-20 06:00:43 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-05-20 06:00:43 -0400 |
commit | d71f4cece4bd97d05592836202fc04ff2e7817e3 (patch) | |
tree | 6c877c7a938758b1323d9c97d46b9c536e618c69 /include/linux | |
parent | 19008bdacb9f7841166ebafe0aef361ee582ffbf (diff) | |
parent | ad8332c1302bcb4f80d593fd3eb477be9d7f5604 (diff) |
Merge branch 'topic/asoc' into for-linus
Conflicts:
sound/soc/codecs/ad1938.c
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2c/twl.h | 6 | ||||
-rw-r--r-- | include/linux/mfd/davinci_voicecodec.h | 126 | ||||
-rw-r--r-- | include/linux/mfd/wm8350/audio.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/wm8994/core.h | 53 | ||||
-rw-r--r-- | include/linux/mfd/wm8994/pdata.h | 1 |
5 files changed, 184 insertions, 4 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index fb6784e86d5f..ebd90ce58ca2 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -569,9 +569,9 @@ struct twl4030_codec_data { | |||
569 | struct twl4030_codec_audio_data *audio; | 569 | struct twl4030_codec_audio_data *audio; |
570 | struct twl4030_codec_vibra_data *vibra; | 570 | struct twl4030_codec_vibra_data *vibra; |
571 | 571 | ||
572 | /* twl6030 */ | 572 | /* twl6040 */ |
573 | int audpwron_gpio; /* audio power-on gpio */ | 573 | int audpwron_gpio; /* audio power-on gpio */ |
574 | int naudint_irq; /* audio interrupt */ | 574 | int naudint_irq; /* audio interrupt */ |
575 | }; | 575 | }; |
576 | 576 | ||
577 | struct twl4030_platform_data { | 577 | struct twl4030_platform_data { |
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h new file mode 100644 index 000000000000..0ab61320ffa8 --- /dev/null +++ b/include/linux/mfd/davinci_voicecodec.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * DaVinci Voice Codec Core Interface for TI platforms | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc | ||
5 | * | ||
6 | * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_MFD_DAVINCI_VOICECODEC_H_ | ||
24 | #define __LINUX_MFD_DAVINIC_VOICECODEC_H_ | ||
25 | |||
26 | #include <linux/kernel.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/mfd/core.h> | ||
29 | |||
30 | #include <mach/edma.h> | ||
31 | |||
32 | /* | ||
33 | * Register values. | ||
34 | */ | ||
35 | #define DAVINCI_VC_PID 0x00 | ||
36 | #define DAVINCI_VC_CTRL 0x04 | ||
37 | #define DAVINCI_VC_INTEN 0x08 | ||
38 | #define DAVINCI_VC_INTSTATUS 0x0c | ||
39 | #define DAVINCI_VC_INTCLR 0x10 | ||
40 | #define DAVINCI_VC_EMUL_CTRL 0x14 | ||
41 | #define DAVINCI_VC_RFIFO 0x20 | ||
42 | #define DAVINCI_VC_WFIFO 0x24 | ||
43 | #define DAVINCI_VC_FIFOSTAT 0x28 | ||
44 | #define DAVINCI_VC_TST_CTRL 0x2C | ||
45 | #define DAVINCI_VC_REG05 0x94 | ||
46 | #define DAVINCI_VC_REG09 0xA4 | ||
47 | #define DAVINCI_VC_REG12 0xB0 | ||
48 | |||
49 | /* DAVINCI_VC_CTRL bit fields */ | ||
50 | #define DAVINCI_VC_CTRL_MASK 0x5500 | ||
51 | #define DAVINCI_VC_CTRL_RSTADC BIT(0) | ||
52 | #define DAVINCI_VC_CTRL_RSTDAC BIT(1) | ||
53 | #define DAVINCI_VC_CTRL_RD_BITS_8 BIT(4) | ||
54 | #define DAVINCI_VC_CTRL_RD_UNSIGNED BIT(5) | ||
55 | #define DAVINCI_VC_CTRL_WD_BITS_8 BIT(6) | ||
56 | #define DAVINCI_VC_CTRL_WD_UNSIGNED BIT(7) | ||
57 | #define DAVINCI_VC_CTRL_RFIFOEN BIT(8) | ||
58 | #define DAVINCI_VC_CTRL_RFIFOCL BIT(9) | ||
59 | #define DAVINCI_VC_CTRL_RFIFOMD_WORD_1 BIT(10) | ||
60 | #define DAVINCI_VC_CTRL_WFIFOEN BIT(12) | ||
61 | #define DAVINCI_VC_CTRL_WFIFOCL BIT(13) | ||
62 | #define DAVINCI_VC_CTRL_WFIFOMD_WORD_1 BIT(14) | ||
63 | |||
64 | /* DAVINCI_VC_INT bit fields */ | ||
65 | #define DAVINCI_VC_INT_MASK 0x3F | ||
66 | #define DAVINCI_VC_INT_RDRDY_MASK BIT(0) | ||
67 | #define DAVINCI_VC_INT_RERROVF_MASK BIT(1) | ||
68 | #define DAVINCI_VC_INT_RERRUDR_MASK BIT(2) | ||
69 | #define DAVINCI_VC_INT_WDREQ_MASK BIT(3) | ||
70 | #define DAVINCI_VC_INT_WERROVF_MASKBIT BIT(4) | ||
71 | #define DAVINCI_VC_INT_WERRUDR_MASK BIT(5) | ||
72 | |||
73 | /* DAVINCI_VC_REG05 bit fields */ | ||
74 | #define DAVINCI_VC_REG05_PGA_GAIN 0x07 | ||
75 | |||
76 | /* DAVINCI_VC_REG09 bit fields */ | ||
77 | #define DAVINCI_VC_REG09_MUTE 0x40 | ||
78 | #define DAVINCI_VC_REG09_DIG_ATTEN 0x3F | ||
79 | |||
80 | /* DAVINCI_VC_REG12 bit fields */ | ||
81 | #define DAVINCI_VC_REG12_POWER_ALL_ON 0xFD | ||
82 | #define DAVINCI_VC_REG12_POWER_ALL_OFF 0x00 | ||
83 | |||
84 | #define DAVINCI_VC_CELLS 2 | ||
85 | |||
86 | enum davinci_vc_cells { | ||
87 | DAVINCI_VC_VCIF_CELL, | ||
88 | DAVINCI_VC_CQ93VC_CELL, | ||
89 | }; | ||
90 | |||
91 | struct davinci_vcif { | ||
92 | struct platform_device *pdev; | ||
93 | u32 dma_tx_channel; | ||
94 | u32 dma_rx_channel; | ||
95 | dma_addr_t dma_tx_addr; | ||
96 | dma_addr_t dma_rx_addr; | ||
97 | }; | ||
98 | |||
99 | struct cq93vc { | ||
100 | struct platform_device *pdev; | ||
101 | struct snd_soc_codec *codec; | ||
102 | u32 sysclk; | ||
103 | }; | ||
104 | |||
105 | struct davinci_vc; | ||
106 | |||
107 | struct davinci_vc { | ||
108 | /* Device data */ | ||
109 | struct device *dev; | ||
110 | struct platform_device *pdev; | ||
111 | struct clk *clk; | ||
112 | |||
113 | /* Memory resources */ | ||
114 | void __iomem *base; | ||
115 | resource_size_t pbase; | ||
116 | size_t base_size; | ||
117 | |||
118 | /* MFD cells */ | ||
119 | struct mfd_cell cells[DAVINCI_VC_CELLS]; | ||
120 | |||
121 | /* Client devices */ | ||
122 | struct davinci_vcif davinci_vcif; | ||
123 | struct cq93vc cq93vc; | ||
124 | }; | ||
125 | |||
126 | #endif | ||
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h index d899dc0223ba..a95141eafce3 100644 --- a/include/linux/mfd/wm8350/audio.h +++ b/include/linux/mfd/wm8350/audio.h | |||
@@ -492,6 +492,8 @@ | |||
492 | */ | 492 | */ |
493 | #define WM8350_JACK_L_LVL 0x0800 | 493 | #define WM8350_JACK_L_LVL 0x0800 |
494 | #define WM8350_JACK_R_LVL 0x0400 | 494 | #define WM8350_JACK_R_LVL 0x0400 |
495 | #define WM8350_JACK_MICSCD_LVL 0x0200 | ||
496 | #define WM8350_JACK_MICSD_LVL 0x0100 | ||
495 | 497 | ||
496 | /* | 498 | /* |
497 | * WM8350 Platform setup | 499 | * WM8350 Platform setup |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index b06ff2846748..de79baee4925 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -15,14 +15,38 @@ | |||
15 | #ifndef __MFD_WM8994_CORE_H__ | 15 | #ifndef __MFD_WM8994_CORE_H__ |
16 | #define __MFD_WM8994_CORE_H__ | 16 | #define __MFD_WM8994_CORE_H__ |
17 | 17 | ||
18 | #include <linux/interrupt.h> | ||
19 | |||
18 | struct regulator_dev; | 20 | struct regulator_dev; |
19 | struct regulator_bulk_data; | 21 | struct regulator_bulk_data; |
20 | 22 | ||
21 | #define WM8994_NUM_GPIO_REGS 11 | 23 | #define WM8994_NUM_GPIO_REGS 11 |
22 | #define WM8994_NUM_LDO_REGS 2 | 24 | #define WM8994_NUM_LDO_REGS 2 |
25 | #define WM8994_NUM_IRQ_REGS 2 | ||
26 | |||
27 | #define WM8994_IRQ_TEMP_SHUT 0 | ||
28 | #define WM8994_IRQ_MIC1_DET 1 | ||
29 | #define WM8994_IRQ_MIC1_SHRT 2 | ||
30 | #define WM8994_IRQ_MIC2_DET 3 | ||
31 | #define WM8994_IRQ_MIC2_SHRT 4 | ||
32 | #define WM8994_IRQ_FLL1_LOCK 5 | ||
33 | #define WM8994_IRQ_FLL2_LOCK 6 | ||
34 | #define WM8994_IRQ_SRC1_LOCK 7 | ||
35 | #define WM8994_IRQ_SRC2_LOCK 8 | ||
36 | #define WM8994_IRQ_AIF1DRC1_SIG_DET 9 | ||
37 | #define WM8994_IRQ_AIF1DRC2_SIG_DET 10 | ||
38 | #define WM8994_IRQ_AIF2DRC_SIG_DET 11 | ||
39 | #define WM8994_IRQ_FIFOS_ERR 12 | ||
40 | #define WM8994_IRQ_WSEQ_DONE 13 | ||
41 | #define WM8994_IRQ_DCS_DONE 14 | ||
42 | #define WM8994_IRQ_TEMP_WARN 15 | ||
43 | |||
44 | /* GPIOs in the chip are numbered from 1-11 */ | ||
45 | #define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN) | ||
23 | 46 | ||
24 | struct wm8994 { | 47 | struct wm8994 { |
25 | struct mutex io_lock; | 48 | struct mutex io_lock; |
49 | struct mutex irq_lock; | ||
26 | 50 | ||
27 | struct device *dev; | 51 | struct device *dev; |
28 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, | 52 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, |
@@ -33,6 +57,11 @@ struct wm8994 { | |||
33 | void *control_data; | 57 | void *control_data; |
34 | 58 | ||
35 | int gpio_base; | 59 | int gpio_base; |
60 | int irq_base; | ||
61 | |||
62 | int irq; | ||
63 | u16 irq_masks_cur[WM8994_NUM_IRQ_REGS]; | ||
64 | u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; | ||
36 | 65 | ||
37 | /* Used over suspend/resume */ | 66 | /* Used over suspend/resume */ |
38 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; | 67 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; |
@@ -51,4 +80,26 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, | |||
51 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, | 80 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, |
52 | int count, u16 *buf); | 81 | int count, u16 *buf); |
53 | 82 | ||
83 | |||
84 | /* Helper to save on boilerplate */ | ||
85 | static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq, | ||
86 | irq_handler_t handler, const char *name, | ||
87 | void *data) | ||
88 | { | ||
89 | if (!wm8994->irq_base) | ||
90 | return -EINVAL; | ||
91 | return request_threaded_irq(wm8994->irq_base + irq, NULL, handler, | ||
92 | IRQF_TRIGGER_RISING, name, | ||
93 | data); | ||
94 | } | ||
95 | static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data) | ||
96 | { | ||
97 | if (!wm8994->irq_base) | ||
98 | return; | ||
99 | free_irq(wm8994->irq_base + irq, data); | ||
100 | } | ||
101 | |||
102 | int wm8994_irq_init(struct wm8994 *wm8994); | ||
103 | void wm8994_irq_exit(struct wm8994 *wm8994); | ||
104 | |||
54 | #endif | 105 | #endif |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 70d6a8687dc5..5c51f367c061 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -70,6 +70,7 @@ struct wm8994_pdata { | |||
70 | 70 | ||
71 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; | 71 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; |
72 | 72 | ||
73 | int irq_base; /** Base IRQ number for WM8994, required for IRQs */ | ||
73 | 74 | ||
74 | int num_drc_cfgs; | 75 | int num_drc_cfgs; |
75 | struct wm8994_drc_cfg *drc_cfgs; | 76 | struct wm8994_drc_cfg *drc_cfgs; |