Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MFD: twl4030-codec -> twl4030-audio: Rename the driver

Rename the driver, and header file from twl4030-codec to
twl4030-audio.
To avoid breakage change depending drivers at the same time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Misael Lopez Cruz <misael.lopez@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>

+43 -44
+1 -1
drivers/input/misc/Kconfig
··· 267 267 config INPUT_TWL4030_VIBRA 268 268 tristate "Support for TWL4030 Vibrator" 269 269 depends on TWL4030_CORE 270 - select TWL4030_CODEC 270 + select MFD_TWL4030_AUDIO 271 271 select INPUT_FF_MEMLESS 272 272 help 273 273 This option enables support for TWL4030 Vibrator Driver.
+5 -5
drivers/input/misc/twl4030-vibra.c
··· 28 28 #include <linux/platform_device.h> 29 29 #include <linux/workqueue.h> 30 30 #include <linux/i2c/twl.h> 31 - #include <linux/mfd/twl4030-codec.h> 31 + #include <linux/mfd/twl4030-audio.h> 32 32 #include <linux/input.h> 33 33 #include <linux/slab.h> 34 34 ··· 67 67 { 68 68 u8 reg; 69 69 70 - twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER); 70 + twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER); 71 71 72 72 /* turn H-Bridge on */ 73 73 twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, ··· 75 75 twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, 76 76 (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL); 77 77 78 - twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL); 78 + twl4030_audio_enable_resource(TWL4030_AUDIO_RES_APLL); 79 79 80 80 info->enabled = true; 81 81 } ··· 90 90 twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, 91 91 (reg & ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL); 92 92 93 - twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL); 94 - twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER); 93 + twl4030_audio_disable_resource(TWL4030_AUDIO_RES_APLL); 94 + twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER); 95 95 96 96 info->enabled = false; 97 97 }
+1 -1
drivers/mfd/Kconfig
··· 218 218 and load scripts controlling which resources are switched off/on 219 219 or reset when a sleep, wakeup or warm reset event occurs. 220 220 221 - config TWL4030_CODEC 221 + config MFD_TWL4030_AUDIO 222 222 bool 223 223 depends on TWL4030_CORE 224 224 select MFD_CORE
+1 -1
drivers/mfd/Makefile
··· 40 40 obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o 41 41 obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o 42 42 obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o 43 - obj-$(CONFIG_TWL4030_CODEC) += twl4030-codec.o 43 + obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o 44 44 obj-$(CONFIG_TWL6030_PWM) += twl6030-pwm.o 45 45 46 46 obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o
+16 -17
drivers/mfd/twl4030-codec.c drivers/mfd/twl4030-audio.c
··· 30 30 #include <linux/platform_device.h> 31 31 #include <linux/i2c/twl.h> 32 32 #include <linux/mfd/core.h> 33 - #include <linux/mfd/twl4030-codec.h> 33 + #include <linux/mfd/twl4030-audio.h> 34 34 35 35 #define TWL4030_AUDIO_CELLS 2 36 36 ··· 45 45 struct twl4030_audio { 46 46 unsigned int audio_mclk; 47 47 struct mutex mutex; 48 - struct twl4030_audio_resource resource[TWL4030_CODEC_RES_MAX]; 48 + struct twl4030_audio_resource resource[TWL4030_AUDIO_RES_MAX]; 49 49 struct mfd_cell cells[TWL4030_AUDIO_CELLS]; 50 50 }; 51 51 ··· 53 53 * Modify the resource, the function returns the content of the register 54 54 * after the modification. 55 55 */ 56 - static int twl4030_audio_set_resource(enum twl4030_codec_res id, int enable) 56 + static int twl4030_audio_set_resource(enum twl4030_audio_res id, int enable) 57 57 { 58 58 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 59 59 u8 val; ··· 72 72 return val; 73 73 } 74 74 75 - static inline int twl4030_audio_get_resource(enum twl4030_codec_res id) 75 + static inline int twl4030_audio_get_resource(enum twl4030_audio_res id) 76 76 { 77 77 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 78 78 u8 val; ··· 87 87 * Enable the resource. 88 88 * The function returns with error or the content of the register 89 89 */ 90 - int twl4030_codec_enable_resource(enum twl4030_codec_res id) 90 + int twl4030_audio_enable_resource(enum twl4030_audio_res id) 91 91 { 92 92 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 93 93 int val; 94 94 95 - if (id >= TWL4030_CODEC_RES_MAX) { 95 + if (id >= TWL4030_AUDIO_RES_MAX) { 96 96 dev_err(&twl4030_audio_dev->dev, 97 97 "Invalid resource ID (%u)\n", id); 98 98 return -EINVAL; ··· 110 110 111 111 return val; 112 112 } 113 - EXPORT_SYMBOL_GPL(twl4030_codec_enable_resource); 113 + EXPORT_SYMBOL_GPL(twl4030_audio_enable_resource); 114 114 115 115 /* 116 116 * Disable the resource. 117 117 * The function returns with error or the content of the register 118 118 */ 119 - int twl4030_codec_disable_resource(unsigned id) 119 + int twl4030_audio_disable_resource(unsigned id) 120 120 { 121 121 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 122 122 int val; 123 123 124 - if (id >= TWL4030_CODEC_RES_MAX) { 124 + if (id >= TWL4030_AUDIO_RES_MAX) { 125 125 dev_err(&twl4030_audio_dev->dev, 126 126 "Invalid resource ID (%u)\n", id); 127 127 return -EINVAL; ··· 146 146 147 147 return val; 148 148 } 149 - EXPORT_SYMBOL_GPL(twl4030_codec_disable_resource); 149 + EXPORT_SYMBOL_GPL(twl4030_audio_disable_resource); 150 150 151 - unsigned int twl4030_codec_get_mclk(void) 151 + unsigned int twl4030_audio_get_mclk(void) 152 152 { 153 153 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 154 154 155 155 return audio->audio_mclk; 156 156 } 157 - EXPORT_SYMBOL_GPL(twl4030_codec_get_mclk); 157 + EXPORT_SYMBOL_GPL(twl4030_audio_get_mclk); 158 158 159 159 static int __devinit twl4030_audio_probe(struct platform_device *pdev) 160 160 { ··· 199 199 audio->audio_mclk = pdata->audio_mclk; 200 200 201 201 /* Codec power */ 202 - audio->resource[TWL4030_CODEC_RES_POWER].reg = TWL4030_REG_CODEC_MODE; 203 - audio->resource[TWL4030_CODEC_RES_POWER].mask = TWL4030_CODECPDZ; 202 + audio->resource[TWL4030_AUDIO_RES_POWER].reg = TWL4030_REG_CODEC_MODE; 203 + audio->resource[TWL4030_AUDIO_RES_POWER].mask = TWL4030_CODECPDZ; 204 204 205 205 /* PLL */ 206 - audio->resource[TWL4030_CODEC_RES_APLL].reg = TWL4030_REG_APLL_CTL; 207 - audio->resource[TWL4030_CODEC_RES_APLL].mask = TWL4030_APLL_EN; 206 + audio->resource[TWL4030_AUDIO_RES_APLL].reg = TWL4030_REG_APLL_CTL; 207 + audio->resource[TWL4030_AUDIO_RES_APLL].mask = TWL4030_APLL_EN; 208 208 209 209 if (pdata->audio) { 210 210 cell = &audio->cells[childs]; ··· 275 275 276 276 MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>"); 277 277 MODULE_LICENSE("GPL"); 278 -
+8 -8
include/linux/mfd/twl4030-codec.h include/linux/mfd/twl4030-audio.h
··· 1 1 /* 2 - * MFD driver for twl4030 codec submodule 2 + * MFD driver for twl4030 audio submodule 3 3 * 4 4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> 5 5 * ··· 259 259 #define TWL4030_VIBRA_DIR_SEL 0x20 260 260 261 261 /* TWL4030 codec resource IDs */ 262 - enum twl4030_codec_res { 263 - TWL4030_CODEC_RES_POWER = 0, 264 - TWL4030_CODEC_RES_APLL, 265 - TWL4030_CODEC_RES_MAX, 262 + enum twl4030_audio_res { 263 + TWL4030_AUDIO_RES_POWER = 0, 264 + TWL4030_AUDIO_RES_APLL, 265 + TWL4030_AUDIO_RES_MAX, 266 266 }; 267 267 268 - int twl4030_codec_disable_resource(enum twl4030_codec_res id); 269 - int twl4030_codec_enable_resource(enum twl4030_codec_res id); 270 - unsigned int twl4030_codec_get_mclk(void); 268 + int twl4030_audio_disable_resource(enum twl4030_audio_res id); 269 + int twl4030_audio_enable_resource(enum twl4030_audio_res id); 270 + unsigned int twl4030_audio_get_mclk(void); 271 271 272 272 #endif /* End of __TWL4030_CODEC_H__ */
+1 -1
sound/soc/codecs/Kconfig
··· 236 236 tristate 237 237 238 238 config SND_SOC_TWL4030 239 - select TWL4030_CODEC 239 + select MFD_TWL4030_AUDIO 240 240 tristate 241 241 242 242 config SND_SOC_TWL6040
+8 -8
sound/soc/codecs/twl4030.c
··· 36 36 #include <sound/tlv.h> 37 37 38 38 /* Register descriptions are here */ 39 - #include <linux/mfd/twl4030-codec.h> 39 + #include <linux/mfd/twl4030-audio.h> 40 40 41 41 /* Shadow register used by the audio driver */ 42 42 #define TWL4030_REG_SW_SHADOW 0x4A ··· 251 251 return; 252 252 253 253 if (enable) 254 - mode = twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER); 254 + mode = twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER); 255 255 else 256 - mode = twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER); 256 + mode = twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER); 257 257 258 258 if (mode >= 0) { 259 259 twl4030_write_reg_cache(codec, TWL4030_REG_CODEC_MODE, mode); ··· 375 375 if (enable) { 376 376 twl4030->apll_enabled++; 377 377 if (twl4030->apll_enabled == 1) 378 - status = twl4030_codec_enable_resource( 379 - TWL4030_CODEC_RES_APLL); 378 + status = twl4030_audio_enable_resource( 379 + TWL4030_AUDIO_RES_APLL); 380 380 } else { 381 381 twl4030->apll_enabled--; 382 382 if (!twl4030->apll_enabled) 383 - status = twl4030_codec_disable_resource( 384 - TWL4030_CODEC_RES_APLL); 383 + status = twl4030_audio_disable_resource( 384 + TWL4030_AUDIO_RES_APLL); 385 385 } 386 386 387 387 if (status >= 0) ··· 2260 2260 } 2261 2261 snd_soc_codec_set_drvdata(codec, twl4030); 2262 2262 /* Set the defaults, and power up the codec */ 2263 - twl4030->sysclk = twl4030_codec_get_mclk() / 1000; 2263 + twl4030->sysclk = twl4030_audio_get_mclk() / 1000; 2264 2264 codec->dapm.idle_bias_off = 1; 2265 2265 2266 2266 twl4030_init_chip(codec);
+1 -1
sound/soc/omap/sdp3430.c
··· 36 36 #include <plat/mcbsp.h> 37 37 38 38 /* Register descriptions for twl4030 codec part */ 39 - #include <linux/mfd/twl4030-codec.h> 39 + #include <linux/mfd/twl4030-audio.h> 40 40 41 41 #include "omap-mcbsp.h" 42 42 #include "omap-pcm.h"
+1 -1
sound/soc/omap/zoom2.c
··· 32 32 #include <plat/mcbsp.h> 33 33 34 34 /* Register descriptions for twl4030 codec part */ 35 - #include <linux/mfd/twl4030-codec.h> 35 + #include <linux/mfd/twl4030-audio.h> 36 36 37 37 #include "omap-mcbsp.h" 38 38 #include "omap-pcm.h"