#include #include #include #include #include #include #include #include #include "irq.h" #include "str.h" #include "die.h" int device_irq_number(const char *ifname) { int irq = 0; char buff[128], sysname[128]; FILE *fp; if (!strncmp("lo", ifname, strlen("lo"))) return 0; slprintf(sysname, sizeof(sysname), "/sys/class/net/%s/device/irq", ifname); fp = fopen(sysname, "r"); if (!fp) return -ENOENT; memset(buff, 0, sizeof(buff)); if (fgets(buff, sizeof(buff), fp) != NULL) { buff[sizeof(buff) - 1] = 0; irq = atoi(buff); } fclose(fp); return irq; } static char nic_irq_affinity_list[128]; static bool nic_irq_stored = false; static int nic_irq = -1; static void device_save_irq_affinity_list(void) { int ret, fd; char file[128]; bug_on(nic_irq_stored); slprintf(file, sizeof(file), "/proc/irq/%d/smp_affinity_list", nic_irq); fd = open(file, O_RDONLY); if (fd < 0) return; memset(nic_irq_affinity_list, 0, sizeof(nic_irq_affinity_list)); ret = read(fd, nic_irq_affinity_list, sizeof(nic_irq_affinity_list)); if (ret < 0) panic("Cannot store NIC IRQ affinity!\n"); close(fd); nic_irq_stored = true; } void device_restore_irq_affinity_list(void) { int ret, fd; char file[128]; if (!nic_irq_stored) return; bug_on(nic_irq == -1); slprintf(file, sizeof(file), "/proc/irq/%d/smp_affinity_list", nic_irq); fd = open(file, O_WRONLY); if (fd < 0) return; ret = write(fd, nic_irq_affinity_list, sizeof(nic_irq_affinity_list)); if (ret < 0) panic("Cannot restore NIC IRQ affinity!\n"); close(fd); } int device_set_irq_affinity_list(int irq, unsigned long from, unsigned long to) { int ret, fd; char file[128], list[64]; if (unlikely(irq == 0)) return 0; if (!nic_irq_stored) { nic_irq = irq; device_save_irq_affinity_list(); } slprintf(file, sizeof(file), "/proc/irq/%d/smp_affinity_list", irq); slprintf(list, sizeof(list), "%lu-%lu\n", from, to); fd = open(file, O_WRONLY); if (fd < 0) return -ENOENT; ret = write(fd, list, strlen(list)); close(fd); return ret; } int device_set_irq_affinity(int irq, unsigned long cpu) { return device_set_irq_affinity_list(irq, cpu, cpu); } class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/sound'>
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-12-12 22:05:20 +0100
committerTakashi Iwai <tiwai@suse.de>2016-12-12 22:05:20 +0100
commit152fce5a2371f64c57abf99dbb0600cc18d399d4 (patch)
treef3b4b8c2cf88cbd5a4a880f8c74b5d23f3f24982 /sound
parentd71bb23a81f80eeb5291e5c782377024e7265a23 (diff)
parenta5de5b74a50113564a1e0850e2da96c37c35e55d (diff)
Merge tag 'asoc-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.10 There's been a few bits of framework work this time around and quite a lot of cleanups and improvements to existing code: - Support for stereo DAPM controls from Chen-yu Tsai. - Some initial work on the of-graph sound card from Morimoto-san, the main bulk of this is currently in binding review. - Lots of Renesas cleanups from Morimoto-san and sunxi work from Chen-yu Tsai. - regmap conversions of the remaining AC'97 drivers from Lars-Peter Clausen. - A new version of the topology ABI from Mengdong Lin. - New drivers for Cirrus Logic CS42L42, Qualcomm MSM8916-WCD, and Realtek RT5665.
Diffstat (limited to 'sound')