wm8776.c (cf0dbba515415bb19b11f9323d5f7bebd7f24fd6) | wm8776.c (b2c812e22de88bb79c290c0e718280f10b64a48d) |
---|---|
1/* 2 * wm8776.c -- WM8776 ALSA SoC Audio driver 3 * 4 * Copyright 2009 Wolfson Microelectronics plc 5 * 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 6 unchanged lines hidden (view full) --- 15#include <linux/module.h> 16#include <linux/moduleparam.h> 17#include <linux/init.h> 18#include <linux/delay.h> 19#include <linux/pm.h> 20#include <linux/i2c.h> 21#include <linux/platform_device.h> 22#include <linux/spi/spi.h> | 1/* 2 * wm8776.c -- WM8776 ALSA SoC Audio driver 3 * 4 * Copyright 2009 Wolfson Microelectronics plc 5 * 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 6 unchanged lines hidden (view full) --- 15#include <linux/module.h> 16#include <linux/moduleparam.h> 17#include <linux/init.h> 18#include <linux/delay.h> 19#include <linux/pm.h> 20#include <linux/i2c.h> 21#include <linux/platform_device.h> 22#include <linux/spi/spi.h> |
23#include <linux/slab.h> | |
24#include <sound/core.h> 25#include <sound/pcm.h> 26#include <sound/pcm_params.h> 27#include <sound/soc.h> 28#include <sound/soc-dapm.h> 29#include <sound/initval.h> 30#include <sound/tlv.h> 31 --- 190 unchanged lines hidden (view full) --- 222 768, 223}; 224 225static int wm8776_hw_params(struct snd_pcm_substream *substream, 226 struct snd_pcm_hw_params *params, 227 struct snd_soc_dai *dai) 228{ 229 struct snd_soc_codec *codec = dai->codec; | 23#include <sound/core.h> 24#include <sound/pcm.h> 25#include <sound/pcm_params.h> 26#include <sound/soc.h> 27#include <sound/soc-dapm.h> 28#include <sound/initval.h> 29#include <sound/tlv.h> 30 --- 190 unchanged lines hidden (view full) --- 221 768, 222}; 223 224static int wm8776_hw_params(struct snd_pcm_substream *substream, 225 struct snd_pcm_hw_params *params, 226 struct snd_soc_dai *dai) 227{ 228 struct snd_soc_codec *codec = dai->codec; |
230 struct wm8776_priv *wm8776 = codec->private_data; | 229 struct wm8776_priv *wm8776 = snd_soc_codec_get_drvdata(codec); |
231 int iface_reg, iface; 232 int ratio_shift, master; 233 int i; 234 235 iface = 0; 236 237 switch (dai->id) { 238 case WM8776_DAI_DAC: --- 60 unchanged lines hidden (view full) --- 299 300 return snd_soc_write(codec, WM8776_DACMUTE, !!mute); 301} 302 303static int wm8776_set_sysclk(struct snd_soc_dai *dai, 304 int clk_id, unsigned int freq, int dir) 305{ 306 struct snd_soc_codec *codec = dai->codec; | 230 int iface_reg, iface; 231 int ratio_shift, master; 232 int i; 233 234 iface = 0; 235 236 switch (dai->id) { 237 case WM8776_DAI_DAC: --- 60 unchanged lines hidden (view full) --- 298 299 return snd_soc_write(codec, WM8776_DACMUTE, !!mute); 300} 301 302static int wm8776_set_sysclk(struct snd_soc_dai *dai, 303 int clk_id, unsigned int freq, int dir) 304{ 305 struct snd_soc_codec *codec = dai->codec; |
307 struct wm8776_priv *wm8776 = codec->private_data; | 306 struct wm8776_priv *wm8776 = snd_soc_codec_get_drvdata(codec); |
308 309 BUG_ON(dai->id >= ARRAY_SIZE(wm8776->sysclk)); 310 311 wm8776->sysclk[dai->id] = freq; 312 313 return 0; 314} 315 --- 170 unchanged lines hidden (view full) --- 486 ret = -EINVAL; 487 goto err; 488 } 489 490 mutex_init(&codec->mutex); 491 INIT_LIST_HEAD(&codec->dapm_widgets); 492 INIT_LIST_HEAD(&codec->dapm_paths); 493 | 307 308 BUG_ON(dai->id >= ARRAY_SIZE(wm8776->sysclk)); 309 310 wm8776->sysclk[dai->id] = freq; 311 312 return 0; 313} 314 --- 170 unchanged lines hidden (view full) --- 485 ret = -EINVAL; 486 goto err; 487 } 488 489 mutex_init(&codec->mutex); 490 INIT_LIST_HEAD(&codec->dapm_widgets); 491 INIT_LIST_HEAD(&codec->dapm_paths); 492 |
494 codec->private_data = wm8776; | 493 snd_soc_codec_set_drvdata(codec, wm8776); |
495 codec->name = "WM8776"; 496 codec->owner = THIS_MODULE; 497 codec->bias_level = SND_SOC_BIAS_OFF; 498 codec->set_bias_level = wm8776_set_bias_level; 499 codec->dai = wm8776_dai; 500 codec->num_dai = ARRAY_SIZE(wm8776_dai); 501 codec->reg_cache_size = WM8776_CACHEREGNUM; 502 codec->reg_cache = &wm8776->reg_cache; --- 202 unchanged lines hidden --- | 494 codec->name = "WM8776"; 495 codec->owner = THIS_MODULE; 496 codec->bias_level = SND_SOC_BIAS_OFF; 497 codec->set_bias_level = wm8776_set_bias_level; 498 codec->dai = wm8776_dai; 499 codec->num_dai = ARRAY_SIZE(wm8776_dai); 500 codec->reg_cache_size = WM8776_CACHEREGNUM; 501 codec->reg_cache = &wm8776->reg_cache; --- 202 unchanged lines hidden --- |