/* sound/soc/samsung/jive_wm8750.c * * Copyright 2007,2008 Simtec Electronics * * Based on sound/soc/pxa/spitz.c * Copyright 2005 Wolfson Microelectronics PLC. * Copyright 2005 Openedhand Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include #include #include #include "s3c2412-i2s.h" #include "../codecs/wm8750.h" static const struct snd_soc_dapm_route audio_map[] = { { "Headphone Jack", NULL, "LOUT1" }, { "Headphone Jack", NULL, "ROUT1" }, { "Internal Speaker", NULL, "LOUT2" }, { "Internal Speaker", NULL, "ROUT2" }, { "LINPUT1", NULL, "Line Input" }, { "RINPUT1", NULL, "Line Input" }, }; static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_SPK("Internal Speaker", NULL), SND_SOC_DAPM_LINE("Line In", NULL), }; static int jive_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct s3c_i2sv2_rate_calc div; unsigned int clk = 0; int ret = 0; switch (params_rate(params)) { case 8000: case 16000: case 48000: case 96000: clk = 12288000; break; case 11025: case 22050: case 44100: clk = 11289600; break; } s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params), s3c_i2sv2_get_clock(cpu_dai)); /* set the codec system clock for DAC and ADC */ ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, SND_SOC_CLOCK_IN); if (ret < 0) return ret; ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C2412_DIV_RCLK, div.fs_div); if (ret < 0) return ret; ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C2412_DIV_PRESCALER, div.clk_div - 1); if (ret < 0) return ret; return 0; } static struct snd_soc_ops jive_ops = { .hw_params = jive_hw_params, }; static struct snd_soc_dai_link jive_dai = { .name = "wm8750", .stream_name = "WM8750", .cpu_dai_name = "s3c2412-i2s", .codec_dai_name = "wm8750-hifi", .platform_name = "s3c2412-i2s", .codec_name = "wm8750.0-001a", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .ops = &jive_ops, }; /* jive audio machine driver */ static struct snd_soc_card snd_soc_machine_jive = { .name = "Jive", .owner = THIS_MODULE, .dai_link = &jive_dai, .num_links = 1, .dapm_widgets = wm8750_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets), .dapm_routes = audio_map, .num_dapm_routes = ARRAY_SIZE(audio_map), .fully_routed = true, }; static struct platform_device *jive_snd_device; static int __init jive_init(void) { int ret; if (!machine_is_jive()) return 0; printk("JIVE WM8750 Audio support\n"); jive_snd_device = platform_device_alloc("soc-audio", -1); if (!jive_snd_device) return -ENOMEM; platform_set_drvdata(jive_snd_device, &snd_soc_machine_jive); ret = platform_device_add(jive_snd_device); if (ret) platform_device_put(jive_snd_device); return ret; } static void __exit jive_exit(void) { platform_device_unregister(jive_snd_device); } module_init(jive_init); module_exit(jive_exit); MODULE_AUTHOR("Ben Dooks "); MODULE_DESCRIPTION("ALSA SoC Jive Audio support"); MODULE_LICENSE("GPL"); href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/misc/sisusbvga?h=nds-private-remove&id=0a764db103376cf69d04449b10688f3516cc0b88'>sisusbvga
diff options
context:
space:
mode:
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>2017-01-27 15:24:43 +0300
committerDavid S. Miller <davem@davemloft.net>2017-01-29 18:15:18 -0500
commit0a764db103376cf69d04449b10688f3516cc0b88 (patch)
tree6789a5c06ce42be32e77d6b40c6eb9baca113650 /drivers/usb/misc/sisusbvga
parent1b1bc42c1692e9b62756323c675a44cb1a1f9dbd (diff)
stmmac: Discard masked flags in interrupt status register
DW GMAC databook says the following about bits in "Register 15 (Interrupt Mask Register)": --------------------------->8------------------------- When set, this bit __disables_the_assertion_of_the_interrupt_signal__ because of the setting of XXX bit in Register 14 (Interrupt Status Register). --------------------------->8------------------------- In fact even if we mask one bit in the mask register it doesn't prevent corresponding bit to appear in the status register, it only disables interrupt generation for corresponding event. But currently we expect a bit different behavior: status bits to be in sync with their masks, i.e. if mask for bit A is set in the mask register then bit A won't appear in the interrupt status register. This was proven to be incorrect assumption, see discussion here [1]. That misunderstanding causes unexpected behaviour of the GMAC, for example we were happy enough to just see bogus messages about link state changes. So from now on we'll be only checking bits that really may trigger an interrupt. [1] https://lkml.org/lkml/2016/11/3/413 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Fabrice Gasnier <fabrice.gasnier@st.com> Cc: Joachim Eastwood <manabian@gmail.com> Cc: Phil Reid <preid@electromag.com.au> Cc: David Miller <davem@davemloft.net> Cc: Alexandre Torgue <alexandre.torgue@gmail.com> Cc: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/usb/misc/sisusbvga')