/* * ADAU1977/ADAU1978/ADAU1979 driver * * Copyright 2014 Analog Devices Inc. * Author: Lars-Peter Clausen * * Licensed under the GPL-2. */ #include #include #include #include #include #include "adau1977.h" static void adau1977_spi_switch_mode(struct device *dev) { struct spi_device *spi = to_spi_device(dev); /* * To get the device into SPI mode CLATCH has to be pulled low three * times. Do this by issuing three dummy reads. */ spi_w8r8(spi, 0x00); spi_w8r8(spi, 0x00); spi_w8r8(spi, 0x00); } static int adau1977_spi_probe(struct spi_device *spi) { const struct spi_device_id *id = spi_get_device_id(spi); struct regmap_config config; if (!id) return -EINVAL; config = adau1977_regmap_config; config.val_bits = 8; config.reg_bits = 16; config.read_flag_mask = 0x1; return adau1977_probe(&spi->dev, devm_regmap_init_spi(spi, &config), id->driver_data, adau1977_spi_switch_mode); } static int adau1977_spi_remove(struct spi_device *spi) { snd_soc_unregister_codec(&spi->dev); return 0; } static const struct spi_device_id adau1977_spi_ids[] = { { "adau1977", ADAU1977 }, { "adau1978", ADAU1978 }, { "adau1979", ADAU1978 }, { } }; MODULE_DEVICE_TABLE(spi, adau1977_spi_ids); static struct spi_driver adau1977_spi_driver = { .driver = { .name = "adau1977", }, .probe = adau1977_spi_probe, .remove = adau1977_spi_remove, .id_table = adau1977_spi_ids, }; module_spi_driver(adau1977_spi_driver); MODULE_DESCRIPTION("ASoC ADAU1977/ADAU1978/ADAU1979 driver"); MODULE_AUTHOR("Lars-Peter Clausen "); MODULE_LICENSE("GPL"); i/linux/net-next.git/log/drivers/usb/mtu3?h=nds-private-remove'>logtreecommitdiff
/log/sound/soc/codecs/wm9081.c?h=nds-private-remove&id=35f9a64506c8dfaf7d6edbf198dedaeaddbf1a7d&showmsg=1'>Expand) on>
AgeCommit message (Expand)AuthorFilesLines
AuthorFilesLines
space:
mode:
authorDexuan Cui <decui@microsoft.com>2017-01-28 11:46:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-31 10:59:48 +0100
commit433e19cf33d34bb6751c874a9c00980552fe508c (patch)
treece6547ef2987fbb289fa28f03536328a42781651 /sound/soc/pxa
parent191e885a2e130e639bb0c8ee350d7047294f2ce6 (diff)
Drivers: hv: vmbus: finally fix hv_need_to_signal_on_read()
Commit a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()") added the proper mb(), but removed the test "prev_write_sz < pending_sz" when making the signal decision. As a result, the guest can signal the host unnecessarily, and then the host can throttle the guest because the host thinks the guest is buggy or malicious; finally the user running stress test can perceive intermittent freeze of the guest. This patch brings back the test, and properly handles the in-place consumption APIs used by NetVSC (see get_next_pkt_raw(), put_pkt_raw() and commit_rd_index()). Fixes: a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()") Signed-off-by: Dexuan Cui <decui@microsoft.com> Reported-by: Rolf Neugebauer <rolf.neugebauer@docker.com> Tested-by: Rolf Neugebauer <rolf.neugebauer@docker.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: <stable@vger.kernel.org> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc/pxa')