Skip to content

Commit

Permalink
Merge pull request torvalds#267 from plbossart/fix/v4.19-intel-audio-…
Browse files Browse the repository at this point in the history
…merge

Fix/v4.19 intel audio merge
  • Loading branch information
plbossart authored Nov 11, 2018
2 parents b068508 + abedb56 commit 9b81e16
Show file tree
Hide file tree
Showing 67 changed files with 311 additions and 164 deletions.
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 @@ -59,9 +59,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

0 comments on commit 9b81e16

Please sign in to comment.