/* * Apple Onboard Audio Alsa helpers * * Copyright 2006 Johannes Berg * * GPL v2, can be found in COPYING. */ #include #include "alsa.h" static int index = -1; module_param(index, int, 0444); MODULE_PARM_DESC(index, "index for AOA sound card."); static struct aoa_card *aoa_card; int aoa_alsa_init(char *name, struct module *mod, struct device *dev) { struct snd_card *alsa_card; int err; if (aoa_card) /* cannot be EEXIST due to usage in aoa_fabric_register */ return -EBUSY; err = snd_card_new(dev, index, name, mod, sizeof(struct aoa_card), &alsa_card); if (err < 0) return err; aoa_card = alsa_card->private_data; aoa_card->alsa_card = alsa_card; strlcpy(alsa_card->driver, "AppleOnbdAudio", sizeof(alsa_card->driver)); strlcpy(alsa_card->shortname, name, sizeof(alsa_card->shortname)); strlcpy(alsa_card->longname, name, sizeof(alsa_card->longname)); strlcpy(alsa_card->mixername, name, sizeof(alsa_card->mixername)); err = snd_card_register(aoa_card->alsa_card); if (err < 0) { printk(KERN_ERR "snd-aoa: couldn't register alsa card\n"); snd_card_free(aoa_card->alsa_card); aoa_card = NULL; return err; } return 0; } struct snd_card *aoa_get_card(void) { if (aoa_card) return aoa_card->alsa_card; return NULL; } EXPORT_SYMBOL_GPL(aoa_get_card); void aoa_alsa_cleanup(void) { if (aoa_card) { snd_card_free(aoa_card->alsa_card); aoa_card = NULL; } } int aoa_snd_device_new(enum snd_device_type type, void * device_data, struct snd_device_ops * ops) { struct snd_card *card = aoa_get_card(); int err; if (!card) return -ENOMEM; err = snd_device_new(card, type, device_data, ops); if (err) { printk(KERN_ERR "snd-aoa: failed to create snd device (%d)\n", err); return err; } err = snd_device_register(card, device_data); if (err) { printk(KERN_ERR "snd-aoa: failed to register " "snd device (%d)\n", err); printk(KERN_ERR "snd-aoa: have you forgotten the " "dev_register callback?\n"); snd_device_free(card, device_data); } return err; } EXPORT_SYMBOL_GPL(aoa_snd_device_new); int aoa_snd_ctl_add(struct snd_kcontrol* control) { int err; if (!aoa_card) return -ENODEV; err = snd_ctl_add(aoa_card->alsa_card, control); if (err) printk(KERN_ERR "snd-aoa: failed to add alsa control (%d)\n", err); return err; } EXPORT_SYMBOL_GPL(aoa_snd_ctl_add); ue='grep'>log msg
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 12:38:43 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 12:38:43 -0800
commit0263d4ebd94b36280608e296cba39b924b6e832b (patch)
tree6e21b4b3d8e8fb12cdfcfd185d46992487265a9b /include/crypto/rng.h
parent19ca2c8fecb1592d623fe5e82d6796f8d446268d (diff)
parent7b9e1d89e1b6a3b99a8fdd949aa0f98dd5bf2f6b (diff)
Merge tag 'platform-drivers-x86-v4.10-4' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform-driver fixes from Andy Shevchenko: "This is my first pull request since I become a co-maintainer of Platform Drivers x86 subsystem. It's a bit bigger than usual due to material collected for almost two weeks in a row. MAINTAINERS: - Add myself to X86 PLATFORM DRIVERS as a co-maintainer ideapad-laptop: - handle ACPI event 1 intel_mid_powerbtn: - Set IRQ_ONESHOT surface3-wmi: - fix uninitialized symbol - Shut up unused-function warning mlx-platform: - free first dev on error" * tag 'platform-drivers-x86-v4.10-4' of git://git.infradead.org/linux-platform-drivers-x86: MAINTAINERS: Add myself to X86 PLATFORM DRIVERS as a co-maintainer platform/x86: ideapad-laptop: handle ACPI event 1 platform/x86: intel_mid_powerbtn: Set IRQ_ONESHOT platform/x86: surface3-wmi: fix uninitialized symbol platform/x86: surface3-wmi: Shut up unused-function warning platform/x86: mlx-platform: free first dev on error
Diffstat (limited to 'include/crypto/rng.h')