diff options
Diffstat (limited to 'sound/soc/soc-cache.c')
-rw-r--r-- | sound/soc/soc-cache.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 4eb4333a0efb..8b126682c843 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c | |||
@@ -11,6 +11,7 @@ | |||
11 | * option) any later version. | 11 | * option) any later version. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/i2c.h> | ||
14 | #include <sound/soc.h> | 15 | #include <sound/soc.h> |
15 | 16 | ||
16 | static unsigned int snd_soc_7_9_read(struct snd_soc_codec *codec, | 17 | static unsigned int snd_soc_7_9_read(struct snd_soc_codec *codec, |
@@ -62,6 +63,7 @@ static struct { | |||
62 | * @type: Type of cache. | 63 | * @type: Type of cache. |
63 | * @addr_bits: Number of bits of register address data. | 64 | * @addr_bits: Number of bits of register address data. |
64 | * @data_bits: Number of bits of data per register. | 65 | * @data_bits: Number of bits of data per register. |
66 | * @control: Control bus used. | ||
65 | * | 67 | * |
66 | * Register formats are frequently shared between many I2C and SPI | 68 | * Register formats are frequently shared between many I2C and SPI |
67 | * devices. In order to promote code reuse the ASoC core provides | 69 | * devices. In order to promote code reuse the ASoC core provides |
@@ -75,7 +77,8 @@ static struct { | |||
75 | * volatile registers. | 77 | * volatile registers. |
76 | */ | 78 | */ |
77 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | 79 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, |
78 | int addr_bits, int data_bits) | 80 | int addr_bits, int data_bits, |
81 | enum snd_soc_control_type control) | ||
79 | { | 82 | { |
80 | int i; | 83 | int i; |
81 | 84 | ||
@@ -100,6 +103,20 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
100 | codec->write = io_types[i].write; | 103 | codec->write = io_types[i].write; |
101 | codec->read = io_types[i].read; | 104 | codec->read = io_types[i].read; |
102 | 105 | ||
106 | switch (control) { | ||
107 | case SND_SOC_CUSTOM: | ||
108 | break; | ||
109 | |||
110 | case SND_SOC_I2C: | ||
111 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
112 | codec->hw_write = (hw_write_t)i2c_master_send; | ||
113 | #endif | ||
114 | break; | ||
115 | |||
116 | case SND_SOC_SPI: | ||
117 | break; | ||
118 | } | ||
119 | |||
103 | return 0; | 120 | return 0; |
104 | } | 121 | } |
105 | EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io); | 122 | EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io); |