Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/v4.19 intel audio merge #267

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
48435ad
ALSA: pcm: Return 0 when size < start_threshold in capture
psqli Aug 25, 2018
69b2311
ALSA: memalloc: Don't align the size to power-of-two
tiwai Aug 8, 2018
88093be
ALSA: memalloc: Simplify snd_malloc_dev_pages() calls
tiwai Aug 10, 2018
04f39c7
ALSA: memalloc: Add non-cached buffer type
tiwai Aug 8, 2018
36b4ebe
regmap: split up regmap_config.use_single_rw
dpfrey Sep 1, 2018
5d5424a
ALSA: pcm: Update hardware pointer before start capture
psqli Sep 7, 2018
2527d12
ALSA: hda: Fix mismatch for register mask and value in ext controller.
keyonjie Sep 28, 2018
c80bd80
ALSA: rawmidi: A lightweight function to discard pending bytes
tiwai Sep 13, 2018
e326ae8
ALSA: memalloc: Add fall-through annotation
tiwai Oct 4, 2018
6b03a07
ASoC: Intel: mrfld: fix uninitialized variable access
arndb Nov 3, 2018
f575459
ASoC: nau8825: remove unnecessary unlikely()
TinyWindzz Nov 4, 2018
e4abd31
ASoC: codecs: constify snd_soc_dai_ops structures
JuliaLawall Oct 27, 2018
02af69d
ASoC: intel: cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_…
jwrdegoede Oct 31, 2018
fb32f41
ASoC: acpi: define common interface for machine driver configuration
plbossart Nov 1, 2018
485454e
ASoC: Intel: use standard interface for Hdaudio machine driver
plbossart Nov 1, 2018
f2ed9a0
ASoC: Intel: use standard interface for Atom machine drivers
plbossart Nov 1, 2018
8d4f2e5
ASoC: Intel: boards: fix Skylake typo
plbossart Nov 1, 2018
8fdfa0a
ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL
plbossart Nov 1, 2018
2e70099
ASoC: Intel: common: add SOF information for APL RVP
bardliao Nov 1, 2018
2279f90
ASoC: Intel: common: add quirk for APL RVP boards
plbossart Nov 1, 2018
928f4c6
ASoC: Intel" bytcr_rt5640: revert SOF-specific changes
plbossart Nov 9, 2018
4edef6e
ASoC: Intel: cht_bsw_rt5645: revert SOF-specific changes
plbossart Nov 9, 2018
2a65aad
ASoC: Intel: skl-generic: revert SOF-specific changes
plbossart Nov 9, 2018
e2910c7
ASoC: SOF: remove codec_mask from sof dev
plbossart Nov 9, 2018
b8ea5c2
ASoC: SOF: Intel: hda: pass codec_mask with new pdata structure
plbossart Nov 9, 2018
abedb56
Merge branch 'backport/v4.19-intel-audio' into fix/v4.19-intel-audio-…
plbossart Nov 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,8 @@ struct regmap *__regmap_init(struct device *dev,
map->reg_stride_order = ilog2(map->reg_stride);
else
map->reg_stride_order = -1;
map->use_single_read = config->use_single_rw || !bus || !bus->read;
map->use_single_write = config->use_single_rw || !bus || !bus->write;
map->use_single_read = config->use_single_read || !bus || !bus->read;
map->use_single_write = config->use_single_write || !bus || !bus->write;
map->can_multi_write = config->can_multi_write && bus && bus->write;
if (bus) {
map->max_raw_read = bus->max_raw_read;
Expand Down
3 changes: 2 additions & 1 deletion drivers/edac/altera_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ static const struct regmap_config s10_sdram_regmap_cfg = {
.volatile_reg = s10_sdram_volatile_reg,
.reg_read = s10_protected_reg_read,
.reg_write = s10_protected_reg_write,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
};

static int altr_s10_sdram_probe(struct platform_device *pdev)
Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/lm75.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ static const struct regmap_config lm75_regmap_config = {
.volatile_reg = lm75_is_volatile_reg,
.val_format_endian = REGMAP_ENDIAN_BIG,
.cache_type = REGCACHE_RBTREE,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
};

static void lm75_remove(void *data)
Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/lm95245.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ static const struct regmap_config lm95245_regmap_config = {
.writeable_reg = lm95245_is_writeable_reg,
.volatile_reg = lm95245_is_volatile_reg,
.cache_type = REGCACHE_RBTREE,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
};

static const u32 lm95245_chip_config[] = {
Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/tmp102.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ static const struct regmap_config tmp102_regmap_config = {
.volatile_reg = tmp102_is_volatile_reg,
.val_format_endian = REGMAP_ENDIAN_BIG,
.cache_type = REGCACHE_RBTREE,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
};

static int tmp102_probe(struct i2c_client *client,
Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/tmp108.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ static const struct regmap_config tmp108_regmap_config = {
.volatile_reg = tmp108_is_volatile_reg,
.val_format_endian = REGMAP_ENDIAN_BIG,
.cache_type = REGCACHE_RBTREE,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
};

static int tmp108_probe(struct i2c_client *client,
Expand Down
3 changes: 2 additions & 1 deletion drivers/iio/light/apds9960.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ static const struct regmap_config apds9960_regmap_config = {
.name = APDS9960_REGMAP_NAME,
.reg_bits = 8,
.val_bits = 8,
.use_single_rw = 1,
.use_single_read = true,
.use_single_write = true,

.volatile_table = &apds9960_volatile_table,
.precious_table = &apds9960_precious_table,
Expand Down
23 changes: 12 additions & 11 deletions drivers/iio/light/max44000.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,18 @@ static bool max44000_precious_reg(struct device *dev, unsigned int reg)
}

static const struct regmap_config max44000_regmap_config = {
.reg_bits = 8,
.val_bits = 8,

.max_register = MAX44000_REG_PRX_DATA,
.readable_reg = max44000_readable_reg,
.writeable_reg = max44000_writeable_reg,
.volatile_reg = max44000_volatile_reg,
.precious_reg = max44000_precious_reg,

.use_single_rw = 1,
.cache_type = REGCACHE_RBTREE,
.reg_bits = 8,
.val_bits = 8,

.max_register = MAX44000_REG_PRX_DATA,
.readable_reg = max44000_readable_reg,
.writeable_reg = max44000_writeable_reg,
.volatile_reg = max44000_volatile_reg,
.precious_reg = max44000_precious_reg,

.use_single_read = true,
.use_single_write = true,
.cache_type = REGCACHE_RBTREE,
};

static irqreturn_t max44000_trigger_handler(int irq, void *p)
Expand Down
3 changes: 2 additions & 1 deletion drivers/iio/temperature/mlx90632.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ static const struct regmap_config mlx90632_regmap = {
.rd_table = &mlx90632_readable_regs_tbl,
.wr_table = &mlx90632_writeable_regs_tbl,

.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
.reg_format_endian = REGMAP_ENDIAN_BIG,
.val_format_endian = REGMAP_ENDIAN_BIG,
.cache_type = REGCACHE_RBTREE,
Expand Down
3 changes: 2 additions & 1 deletion drivers/input/touchscreen/tsc200x-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ const struct regmap_config tsc200x_regmap_config = {
.read_flag_mask = TSC200X_REG_READ,
.write_flag_mask = TSC200X_REG_PND0,
.wr_table = &tsc200x_writable_table,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
};
EXPORT_SYMBOL_GPL(tsc200x_regmap_config);

Expand Down
3 changes: 2 additions & 1 deletion drivers/mfd/altera-a10sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ static const struct regmap_config altr_a10sr_regmap_config = {

.cache_type = REGCACHE_NONE,

.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
.read_flag_mask = 1,
.write_flag_mask = 0,

Expand Down
3 changes: 2 additions & 1 deletion drivers/mfd/da9052-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ static int da9052_spi_probe(struct spi_device *spi)
config.reg_bits = 7;
config.pad_bits = 1;
config.val_bits = 8;
config.use_single_rw = 1;
config.use_single_read = true;
config.use_single_write = true;

da9052->regmap = devm_regmap_init_spi(spi, &config);
if (IS_ERR(da9052->regmap)) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/mfd/mc13xxx-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ static const struct regmap_config mc13xxx_regmap_spi_config = {
.max_register = MC13XXX_NUMREGS,

.cache_type = REGCACHE_NONE,
.use_single_rw = 1,
.use_single_read = true,
.use_single_write = true,
};

static int mc13xxx_spi_read(void *context, const void *reg, size_t reg_size,
Expand Down
3 changes: 2 additions & 1 deletion drivers/mfd/twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,8 @@ static const struct regmap_config twl6040_regmap_config = {
.writeable_reg = twl6040_writeable_reg,

.cache_type = REGCACHE_RBTREE,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
};

static const struct regmap_irq twl6040_irqs[] = {
Expand Down
3 changes: 2 additions & 1 deletion drivers/regulator/ltc3589.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ static const struct regmap_config ltc3589_regmap_config = {
.max_register = LTC3589_L2DTV2,
.reg_defaults = ltc3589_reg_defaults,
.num_reg_defaults = ARRAY_SIZE(ltc3589_reg_defaults),
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
.cache_type = REGCACHE_RBTREE,
};

Expand Down
3 changes: 2 additions & 1 deletion drivers/regulator/ltc3676.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ static const struct regmap_config ltc3676_regmap_config = {
.readable_reg = ltc3676_readable_reg,
.volatile_reg = ltc3676_volatile_reg,
.max_register = LTC3676_CLIRQ,
.use_single_rw = true,
.use_single_read = true,
.use_single_write = true,
.cache_type = REGCACHE_RBTREE,
};

Expand Down
12 changes: 8 additions & 4 deletions include/linux/regmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,12 @@ typedef void (*regmap_unlock)(void *);
* masks are used.
* @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even
* if they are both empty.
* @use_single_rw: If set, converts the bulk read and write operations into
* a series of single read and write operations. This is useful
* for device that does not support bulk read and write.
* @use_single_read: If set, converts the bulk read operation into a series of
* single read operations. This is useful for a device that
* does not support bulk read.
* @use_single_write: If set, converts the bulk write operation into a series of
* single write operations. This is useful for a device that
* does not support bulk write.
* @can_multi_write: If set, the device supports the multi write mode of bulk
* write operations, if clear multi write requests will be
* split into individual write operations
Expand Down Expand Up @@ -380,7 +383,8 @@ struct regmap_config {
unsigned long write_flag_mask;
bool zero_flag_mask;

bool use_single_rw;
bool use_single_read;
bool use_single_write;
bool can_multi_write;

enum regmap_endian reg_format_endian;
Expand Down
3 changes: 3 additions & 0 deletions include/sound/memalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ struct snd_dma_device {
#define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */
#define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */
#define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */
#define SNDRV_DMA_TYPE_DEV_UC 5 /* continuous non-cahced */
#ifdef CONFIG_SND_DMA_SGBUF
#define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */
#define SNDRV_DMA_TYPE_DEV_UC_SG 6 /* SG non-cached */
#else
#define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */
#define SNDRV_DMA_TYPE_DEV_UC_SG SNDRV_DMA_TYPE_DEV_UC
#endif
#ifdef CONFIG_GENERIC_ALLOCATOR
#define SNDRV_DMA_TYPE_DEV_IRAM 4 /* generic device iram-buffer */
Expand Down
1 change: 1 addition & 0 deletions include/sound/rawmidi.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ int __snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
unsigned char *buffer, int count);
int __snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream,
int count);
int snd_rawmidi_proceed(struct snd_rawmidi_substream *substream);

/* main midi functions */

Expand Down
14 changes: 14 additions & 0 deletions include/sound/soc-acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
struct snd_soc_acpi_mach *
snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines);

/**
* snd_soc_acpi_mach_params: interface for machine driver configuration
*
* @acpi_ipc_irq_index: used for BYT-CR detection
* @platform: string used for HDaudio codec support
* @codec_mask: used for HDAudio support
*/
struct snd_soc_acpi_mach_params {
u32 acpi_ipc_irq_index;
const char *platform;
u32 codec_mask;
};

/**
* snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are
* related to the hardware, except for the firmware and topology file names.
Expand Down Expand Up @@ -68,6 +81,7 @@ struct snd_soc_acpi_mach {
struct snd_soc_acpi_mach * (*machine_quirk)(void *arg);
const void *quirk_data;
void *pdata;
struct snd_soc_acpi_mach_params mach_params;
const char *sof_fw_filename;
const char *sof_tplg_filename;
const char *asoc_plat_name;
Expand Down
3 changes: 0 additions & 3 deletions include/sound/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ struct snd_sof_pdata {
unsigned int gpio;
unsigned int active;

/* hda codec */
unsigned long codec_mask;

/* machine */
struct platform_device *pdev_mach;
union {
Expand Down
41 changes: 25 additions & 16 deletions sound/core/memalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <linux/mm.h>
#include <linux/dma-mapping.h>
#include <linux/genalloc.h>
#ifdef CONFIG_X86
#include <asm/set_memory.h>
#endif
#include <sound/memalloc.h>

/*
Expand Down Expand Up @@ -82,31 +85,32 @@ EXPORT_SYMBOL(snd_free_pages);

#ifdef CONFIG_HAS_DMA
/* allocate the coherent DMA pages */
static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma)
static void snd_malloc_dev_pages(struct snd_dma_buffer *dmab, size_t size)
{
int pg;
gfp_t gfp_flags;

if (WARN_ON(!dma))
return NULL;
pg = get_order(size);
gfp_flags = GFP_KERNEL
| __GFP_COMP /* compound page lets parts be mapped */
| __GFP_NORETRY /* don't trigger OOM-killer */
| __GFP_NOWARN; /* no stack trace print - this call is non-critical */
return dma_alloc_coherent(dev, PAGE_SIZE << pg, dma, gfp_flags);
dmab->area = dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr,
gfp_flags);
#ifdef CONFIG_X86
if (dmab->area && dmab->dev.type == SNDRV_DMA_TYPE_DEV_UC)
set_memory_wc((unsigned long)dmab->area,
PAGE_ALIGN(size) >> PAGE_SHIFT);
#endif
}

/* free the coherent DMA pages */
static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr,
dma_addr_t dma)
static void snd_free_dev_pages(struct snd_dma_buffer *dmab)
{
int pg;

if (ptr == NULL)
return;
pg = get_order(size);
dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma);
#ifdef CONFIG_X86
if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_UC)
set_memory_wb((unsigned long)dmab->area,
PAGE_ALIGN(dmab->bytes) >> PAGE_SHIFT);
#endif
dma_free_coherent(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
}

#ifdef CONFIG_GENERIC_ALLOCATOR
Expand Down Expand Up @@ -199,12 +203,15 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
*/
dmab->dev.type = SNDRV_DMA_TYPE_DEV;
#endif /* CONFIG_GENERIC_ALLOCATOR */
/* fall through */
case SNDRV_DMA_TYPE_DEV:
dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr);
case SNDRV_DMA_TYPE_DEV_UC:
snd_malloc_dev_pages(dmab, size);
break;
#endif
#ifdef CONFIG_SND_DMA_SGBUF
case SNDRV_DMA_TYPE_DEV_SG:
case SNDRV_DMA_TYPE_DEV_UC_SG:
snd_malloc_sgbuf_pages(device, size, dmab, NULL);
break;
#endif
Expand Down Expand Up @@ -275,11 +282,13 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab)
break;
#endif /* CONFIG_GENERIC_ALLOCATOR */
case SNDRV_DMA_TYPE_DEV:
snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
case SNDRV_DMA_TYPE_DEV_UC:
snd_free_dev_pages(dmab);
break;
#endif
#ifdef CONFIG_SND_DMA_SGBUF
case SNDRV_DMA_TYPE_DEV_SG:
case SNDRV_DMA_TYPE_DEV_UC_SG:
snd_free_sgbuf_pages(dmab);
break;
#endif
Expand Down
21 changes: 14 additions & 7 deletions sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,18 +2172,25 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
if (err < 0)
goto _end_unlock;

runtime->twake = runtime->control->avail_min ? : 1;
if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
snd_pcm_update_hw_ptr(substream);

if (!is_playback &&
runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
size >= runtime->start_threshold) {
err = snd_pcm_start(substream);
if (err < 0)
runtime->status->state == SNDRV_PCM_STATE_PREPARED) {
if (size >= runtime->start_threshold) {
err = snd_pcm_start(substream);
if (err < 0)
goto _end_unlock;
} else {
/* nothing to do */
err = 0;
goto _end_unlock;
}
}

runtime->twake = runtime->control->avail_min ? : 1;
if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
snd_pcm_update_hw_ptr(substream);
avail = snd_pcm_avail(substream);

while (size > 0) {
snd_pcm_uframes_t frames, appl_ptr, appl_ofs;
snd_pcm_uframes_t cont;
Expand Down
Loading