uda1380.c (cc9b94029e9ef51787af908e9856b1eed314bc00) | uda1380.c (4a5cf1320a9501261919cf96af300b1df3ad0210) |
---|---|
1/* 2 * uda1380.c - Philips UDA1380 ALSA SoC audio driver 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 * 8 * Copyright (c) 2007-2009 Philipp Zabel <philipp.zabel@gmail.com> --- 761 unchanged lines hidden (view full) --- 770 .num_controls = ARRAY_SIZE(uda1380_snd_controls), 771 .dapm_widgets = uda1380_dapm_widgets, 772 .num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets), 773 .dapm_routes = uda1380_dapm_routes, 774 .num_dapm_routes = ARRAY_SIZE(uda1380_dapm_routes), 775 }, 776}; 777 | 1/* 2 * uda1380.c - Philips UDA1380 ALSA SoC audio driver 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 * 8 * Copyright (c) 2007-2009 Philipp Zabel <philipp.zabel@gmail.com> --- 761 unchanged lines hidden (view full) --- 770 .num_controls = ARRAY_SIZE(uda1380_snd_controls), 771 .dapm_widgets = uda1380_dapm_widgets, 772 .num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets), 773 .dapm_routes = uda1380_dapm_routes, 774 .num_dapm_routes = ARRAY_SIZE(uda1380_dapm_routes), 775 }, 776}; 777 |
778#if IS_ENABLED(CONFIG_I2C) | |
779static int uda1380_i2c_probe(struct i2c_client *i2c, 780 const struct i2c_device_id *id) 781{ 782 struct uda1380_priv *uda1380; 783 int ret; 784 785 uda1380 = devm_kzalloc(&i2c->dev, sizeof(struct uda1380_priv), 786 GFP_KERNEL); --- 23 unchanged lines hidden (view full) --- 810static struct i2c_driver uda1380_i2c_driver = { 811 .driver = { 812 .name = "uda1380-codec", 813 }, 814 .probe = uda1380_i2c_probe, 815 .remove = uda1380_i2c_remove, 816 .id_table = uda1380_i2c_id, 817}; | 778static int uda1380_i2c_probe(struct i2c_client *i2c, 779 const struct i2c_device_id *id) 780{ 781 struct uda1380_priv *uda1380; 782 int ret; 783 784 uda1380 = devm_kzalloc(&i2c->dev, sizeof(struct uda1380_priv), 785 GFP_KERNEL); --- 23 unchanged lines hidden (view full) --- 809static struct i2c_driver uda1380_i2c_driver = { 810 .driver = { 811 .name = "uda1380-codec", 812 }, 813 .probe = uda1380_i2c_probe, 814 .remove = uda1380_i2c_remove, 815 .id_table = uda1380_i2c_id, 816}; |
818#endif | |
819 | 817 |
820static int __init uda1380_modinit(void) 821{ 822 int ret = 0; 823#if IS_ENABLED(CONFIG_I2C) 824 ret = i2c_add_driver(&uda1380_i2c_driver); 825 if (ret != 0) 826 pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); 827#endif 828 return ret; 829} 830module_init(uda1380_modinit); | 818module_i2c_driver(uda1380_i2c_driver); |
831 | 819 |
832static void __exit uda1380_exit(void) 833{ 834#if IS_ENABLED(CONFIG_I2C) 835 i2c_del_driver(&uda1380_i2c_driver); 836#endif 837} 838module_exit(uda1380_exit); 839 | |
840MODULE_AUTHOR("Giorgio Padrin"); 841MODULE_DESCRIPTION("Audio support for codec Philips UDA1380"); 842MODULE_LICENSE("GPL"); | 820MODULE_AUTHOR("Giorgio Padrin"); 821MODULE_DESCRIPTION("Audio support for codec Philips UDA1380"); 822MODULE_LICENSE("GPL"); |