wm8974.c (cb11d39ead79e5bc8ca42de86b9df8dec8b88681) wm8974.c (8b83a19367dc3bdfef07634646bbad90f6cba898)
1/*
2 * wm8974.c -- WM8974 ALSA Soc Audio driver
3 *
1/*
2 * wm8974.c -- WM8974 ALSA Soc Audio driver
3 *
4 * Copyright 2006 Wolfson Microelectronics PLC.
4 * Copyright 2006-2009 Wolfson Microelectronics PLC.
5 *
6 * Author: Liam Girdwood <linux@wolfsonmicro.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 version 2 as
10 * published by the Free Software Foundation.
11 */
12

--- 339 unchanged lines hidden (view full) ---

352 source >>= 1;
353 pll_div.pre_div = 1;
354 Ndiv = target / source;
355 } else
356 pll_div.pre_div = 0;
357
358 if ((Ndiv < 6) || (Ndiv > 12))
359 printk(KERN_WARNING
5 *
6 * Author: Liam Girdwood <linux@wolfsonmicro.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 version 2 as
10 * published by the Free Software Foundation.
11 */
12

--- 339 unchanged lines hidden (view full) ---

352 source >>= 1;
353 pll_div.pre_div = 1;
354 Ndiv = target / source;
355 } else
356 pll_div.pre_div = 0;
357
358 if ((Ndiv < 6) || (Ndiv > 12))
359 printk(KERN_WARNING
360 "WM8974 N value %u outwith recommended range!d\n",
360 "WM8974 N value %u outwith recommended range!\n",
361 Ndiv);
362
363 pll_div.n = Ndiv;
364 Nmod = target % source;
365 Kpart = FIXED_PLL_SIZE * (long long)Nmod;
366
367 do_div(Kpart, source);
368

--- 172 unchanged lines hidden (view full) ---

541 break;
542 case SNDRV_PCM_RATE_22050:
543 adn |= 0x2 << 1;
544 break;
545 case SNDRV_PCM_RATE_32000:
546 adn |= 0x1 << 1;
547 break;
548 case SNDRV_PCM_RATE_44100:
361 Ndiv);
362
363 pll_div.n = Ndiv;
364 Nmod = target % source;
365 Kpart = FIXED_PLL_SIZE * (long long)Nmod;
366
367 do_div(Kpart, source);
368

--- 172 unchanged lines hidden (view full) ---

541 break;
542 case SNDRV_PCM_RATE_22050:
543 adn |= 0x2 << 1;
544 break;
545 case SNDRV_PCM_RATE_32000:
546 adn |= 0x1 << 1;
547 break;
548 case SNDRV_PCM_RATE_44100:
549 case SNDRV_PCM_RATE_48000:
549 break;
550 }
551
552 wm8974_write(codec, WM8974_IFACE, iface);
553 wm8974_write(codec, WM8974_ADD, adn);
554 return 0;
555}
556

--- 260 unchanged lines hidden (view full) ---

817static const struct i2c_device_id wm8974_i2c_id[] = {
818 { "wm8974", 0 },
819 { }
820};
821MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id);
822
823static struct i2c_driver wm8974_i2c_driver = {
824 .driver = {
550 break;
551 }
552
553 wm8974_write(codec, WM8974_IFACE, iface);
554 wm8974_write(codec, WM8974_ADD, adn);
555 return 0;
556}
557

--- 260 unchanged lines hidden (view full) ---

818static const struct i2c_device_id wm8974_i2c_id[] = {
819 { "wm8974", 0 },
820 { }
821};
822MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id);
823
824static struct i2c_driver wm8974_i2c_driver = {
825 .driver = {
825 .name = "WM8974 I2C Codec",
826 .name = "WM8974",
826 .owner = THIS_MODULE,
827 },
828 .probe = wm8974_i2c_probe,
829 .remove = __devexit_p(wm8974_i2c_remove),
830 .id_table = wm8974_i2c_id,
831};
832
833static int __init wm8974_modinit(void)

--- 14 unchanged lines hidden ---
827 .owner = THIS_MODULE,
828 },
829 .probe = wm8974_i2c_probe,
830 .remove = __devexit_p(wm8974_i2c_remove),
831 .id_table = wm8974_i2c_id,
832};
833
834static int __init wm8974_modinit(void)

--- 14 unchanged lines hidden ---