wm8974.c (a2bd691c64383ab290732d771a7404e26c0b9d53) | wm8974.c (c2562a8e3b5f871ad0b73caf98bb7541e8724efc) |
---|---|
1/* 2 * wm8974.c -- WM8974 ALSA Soc Audio driver 3 * 4 * Copyright 2006-2009 Wolfson Microelectronics PLC. 5 * 6 * Author: Liam Girdwood <Liam.Girdwood@wolfsonmicro.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 34 unchanged lines hidden (view full) --- 43 0x0000, 0x0002, 0x0000, 0x0000, 44 0x0000, 0x0000, 0x0039, 0x0000, 45 0x0000, 46}; 47 48#define WM8974_POWER1_BIASEN 0x08 49#define WM8974_POWER1_BUFIOEN 0x04 50 | 1/* 2 * wm8974.c -- WM8974 ALSA Soc Audio driver 3 * 4 * Copyright 2006-2009 Wolfson Microelectronics PLC. 5 * 6 * Author: Liam Girdwood <Liam.Girdwood@wolfsonmicro.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 34 unchanged lines hidden (view full) --- 43 0x0000, 0x0002, 0x0000, 0x0000, 44 0x0000, 0x0000, 0x0039, 0x0000, 45 0x0000, 46}; 47 48#define WM8974_POWER1_BIASEN 0x08 49#define WM8974_POWER1_BUFIOEN 0x04 50 |
51struct wm8974_priv { 52 enum snd_soc_control_type control_type; 53}; 54 | |
55#define wm8974_reset(c) snd_soc_write(c, WM8974_RESET, 0) 56 57static const char *wm8974_companding[] = {"Off", "NC", "u-law", "A-law" }; 58static const char *wm8974_deemp[] = {"None", "32kHz", "44.1kHz", "48kHz" }; 59static const char *wm8974_eqmode[] = {"Capture", "Playback" }; 60static const char *wm8974_bw[] = {"Narrow", "Wide" }; 61static const char *wm8974_eq1[] = {"80Hz", "105Hz", "135Hz", "175Hz" }; 62static const char *wm8974_eq2[] = {"230Hz", "300Hz", "385Hz", "500Hz" }; --- 564 unchanged lines hidden (view full) --- 627 .num_dapm_widgets = ARRAY_SIZE(wm8974_dapm_widgets), 628 .dapm_routes = wm8974_dapm_routes, 629 .num_dapm_routes = ARRAY_SIZE(wm8974_dapm_routes), 630}; 631 632static __devinit int wm8974_i2c_probe(struct i2c_client *i2c, 633 const struct i2c_device_id *id) 634{ | 51#define wm8974_reset(c) snd_soc_write(c, WM8974_RESET, 0) 52 53static const char *wm8974_companding[] = {"Off", "NC", "u-law", "A-law" }; 54static const char *wm8974_deemp[] = {"None", "32kHz", "44.1kHz", "48kHz" }; 55static const char *wm8974_eqmode[] = {"Capture", "Playback" }; 56static const char *wm8974_bw[] = {"Narrow", "Wide" }; 57static const char *wm8974_eq1[] = {"80Hz", "105Hz", "135Hz", "175Hz" }; 58static const char *wm8974_eq2[] = {"230Hz", "300Hz", "385Hz", "500Hz" }; --- 564 unchanged lines hidden (view full) --- 623 .num_dapm_widgets = ARRAY_SIZE(wm8974_dapm_widgets), 624 .dapm_routes = wm8974_dapm_routes, 625 .num_dapm_routes = ARRAY_SIZE(wm8974_dapm_routes), 626}; 627 628static __devinit int wm8974_i2c_probe(struct i2c_client *i2c, 629 const struct i2c_device_id *id) 630{ |
635 struct wm8974_priv *wm8974; | |
636 int ret; 637 | 631 int ret; 632 |
638 wm8974 = kzalloc(sizeof(struct wm8974_priv), GFP_KERNEL); 639 if (wm8974 == NULL) 640 return -ENOMEM; 641 642 i2c_set_clientdata(i2c, wm8974); 643 | |
644 ret = snd_soc_register_codec(&i2c->dev, 645 &soc_codec_dev_wm8974, &wm8974_dai, 1); | 633 ret = snd_soc_register_codec(&i2c->dev, 634 &soc_codec_dev_wm8974, &wm8974_dai, 1); |
646 if (ret < 0) 647 kfree(wm8974); | 635 |
648 return ret; 649} 650 651static __devexit int wm8974_i2c_remove(struct i2c_client *client) 652{ 653 snd_soc_unregister_codec(&client->dev); | 636 return ret; 637} 638 639static __devexit int wm8974_i2c_remove(struct i2c_client *client) 640{ 641 snd_soc_unregister_codec(&client->dev); |
654 kfree(i2c_get_clientdata(client)); | 642 |
655 return 0; 656} 657 658static const struct i2c_device_id wm8974_i2c_id[] = { 659 { "wm8974", 0 }, 660 { } 661}; 662MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id); --- 32 unchanged lines hidden --- | 643 return 0; 644} 645 646static const struct i2c_device_id wm8974_i2c_id[] = { 647 { "wm8974", 0 }, 648 { } 649}; 650MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id); --- 32 unchanged lines hidden --- |