Merge 0ef6153de6 ("drm/amdgpu/gfx7: fix CSIB handling") into android12-5.10-lts
Steps on the way to 5.10.239 Change-Id: Ia2f4e0d9e4d01d18cb236e9cbbfea99e686b9bf4 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -29,6 +29,7 @@ endif
|
||||
# offsets.
|
||||
cflags-vdso := $(ccflags-vdso) \
|
||||
$(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
|
||||
$(filter -std=%,$(KBUILD_CFLAGS)) \
|
||||
-O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
|
||||
-mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
|
||||
-fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
|
||||
|
||||
@@ -22,6 +22,7 @@ KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs -Os
|
||||
ifndef CONFIG_64BIT
|
||||
KBUILD_CFLAGS += -mfast-indirect-calls
|
||||
endif
|
||||
KBUILD_CFLAGS += -std=gnu11
|
||||
|
||||
OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o
|
||||
|
||||
|
||||
@@ -668,6 +668,8 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object *arguments[ACPI_OBJ_NUM_OPERANDS];
|
||||
u32 arg_count = 0;
|
||||
u32 index = walk_state->num_operands;
|
||||
u32 prev_num_operands = walk_state->num_operands;
|
||||
u32 new_num_operands;
|
||||
u32 i;
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR(ds_create_operands, first_arg);
|
||||
@@ -696,6 +698,7 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
|
||||
|
||||
/* Create the interpreter arguments, in reverse order */
|
||||
|
||||
new_num_operands = index;
|
||||
index--;
|
||||
for (i = 0; i < arg_count; i++) {
|
||||
arg = arguments[index];
|
||||
@@ -720,7 +723,11 @@ cleanup:
|
||||
* pop everything off of the operand stack and delete those
|
||||
* objects
|
||||
*/
|
||||
acpi_ds_obj_stack_pop_and_delete(arg_count, walk_state);
|
||||
walk_state->num_operands = i;
|
||||
acpi_ds_obj_stack_pop_and_delete(new_num_operands, walk_state);
|
||||
|
||||
/* Restore operand count */
|
||||
walk_state->num_operands = prev_num_operands;
|
||||
|
||||
ACPI_EXCEPTION((AE_INFO, status, "While creating Arg %u", index));
|
||||
return_ACPI_STATUS(status);
|
||||
|
||||
@@ -636,7 +636,8 @@ acpi_status
|
||||
acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object *op, acpi_status status)
|
||||
{
|
||||
acpi_status status2;
|
||||
acpi_status return_status = status;
|
||||
u8 ascending = TRUE;
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR(ps_complete_final_op, walk_state);
|
||||
|
||||
@@ -650,7 +651,7 @@ acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
|
||||
op));
|
||||
do {
|
||||
if (op) {
|
||||
if (walk_state->ascending_callback != NULL) {
|
||||
if (ascending && walk_state->ascending_callback != NULL) {
|
||||
walk_state->op = op;
|
||||
walk_state->op_info =
|
||||
acpi_ps_get_opcode_info(op->common.
|
||||
@@ -672,49 +673,26 @@ acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
|
||||
}
|
||||
|
||||
if (status == AE_CTRL_TERMINATE) {
|
||||
status = AE_OK;
|
||||
|
||||
/* Clean up */
|
||||
do {
|
||||
if (op) {
|
||||
status2 =
|
||||
acpi_ps_complete_this_op
|
||||
(walk_state, op);
|
||||
if (ACPI_FAILURE
|
||||
(status2)) {
|
||||
return_ACPI_STATUS
|
||||
(status2);
|
||||
}
|
||||
}
|
||||
|
||||
acpi_ps_pop_scope(&
|
||||
(walk_state->
|
||||
parser_state),
|
||||
&op,
|
||||
&walk_state->
|
||||
arg_types,
|
||||
&walk_state->
|
||||
arg_count);
|
||||
|
||||
} while (op);
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
ascending = FALSE;
|
||||
return_status = AE_CTRL_TERMINATE;
|
||||
}
|
||||
|
||||
else if (ACPI_FAILURE(status)) {
|
||||
|
||||
/* First error is most important */
|
||||
|
||||
(void)
|
||||
acpi_ps_complete_this_op(walk_state,
|
||||
op);
|
||||
return_ACPI_STATUS(status);
|
||||
ascending = FALSE;
|
||||
return_status = status;
|
||||
}
|
||||
}
|
||||
|
||||
status2 = acpi_ps_complete_this_op(walk_state, op);
|
||||
if (ACPI_FAILURE(status2)) {
|
||||
return_ACPI_STATUS(status2);
|
||||
status = acpi_ps_complete_this_op(walk_state, op);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ascending = FALSE;
|
||||
if (ACPI_SUCCESS(return_status) ||
|
||||
return_status == AE_CTRL_TERMINATE) {
|
||||
return_status = status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,5 +702,5 @@ acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
|
||||
|
||||
} while (op);
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
return_ACPI_STATUS(return_status);
|
||||
}
|
||||
|
||||
@@ -333,11 +333,8 @@ int vsnprintf(char *string, acpi_size size, const char *format, va_list args)
|
||||
|
||||
pos = string;
|
||||
|
||||
if (size != ACPI_UINT32_MAX) {
|
||||
end = string + size;
|
||||
} else {
|
||||
end = ACPI_CAST_PTR(char, ACPI_UINT32_MAX);
|
||||
}
|
||||
size = ACPI_MIN(size, ACPI_PTR_DIFF(ACPI_MAX_PTR, string));
|
||||
end = string + size;
|
||||
|
||||
for (; *format; ++format) {
|
||||
if (*format != '%') {
|
||||
|
||||
@@ -255,10 +255,23 @@ static int acpi_battery_get_property(struct power_supply *psy,
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_CURRENT_NOW:
|
||||
case POWER_SUPPLY_PROP_POWER_NOW:
|
||||
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
|
||||
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN) {
|
||||
ret = -ENODEV;
|
||||
else
|
||||
val->intval = battery->rate_now * 1000;
|
||||
break;
|
||||
}
|
||||
|
||||
val->intval = battery->rate_now * 1000;
|
||||
/*
|
||||
* When discharging, the current should be reported as a
|
||||
* negative number as per the power supply class interface
|
||||
* definition.
|
||||
*/
|
||||
if (psp == POWER_SUPPLY_PROP_CURRENT_NOW &&
|
||||
(battery->state & ACPI_BATTERY_STATE_DISCHARGING) &&
|
||||
acpi_battery_handle_discharging(battery)
|
||||
== POWER_SUPPLY_STATUS_DISCHARGING)
|
||||
val->intval = -val->intval;
|
||||
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
|
||||
case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
|
||||
|
||||
@@ -368,7 +368,8 @@ static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask)
|
||||
}
|
||||
|
||||
if (dev->class == ATA_DEV_ATAPI &&
|
||||
dmi_check_system(no_atapi_dma_dmi_table)) {
|
||||
(dmi_check_system(no_atapi_dma_dmi_table) ||
|
||||
config->id == PCI_DEVICE_ID_VIA_6415)) {
|
||||
ata_dev_warn(dev, "controller locks up on ATAPI DMA, forcing PIO\n");
|
||||
mask &= ATA_MASK_PIO;
|
||||
}
|
||||
|
||||
@@ -998,7 +998,7 @@ static enum hrtimer_restart pm_suspend_timer_fn(struct hrtimer *timer)
|
||||
* If 'expires' is after the current time, we've been called
|
||||
* too early.
|
||||
*/
|
||||
if (expires > 0 && expires < ktime_get_mono_fast_ns()) {
|
||||
if (expires > 0 && expires <= ktime_get_mono_fast_ns()) {
|
||||
dev->power.timer_expires = 0;
|
||||
rpm_suspend(dev, dev->power.timer_autosuspends ?
|
||||
(RPM_ASYNC | RPM_AUTO) : RPM_ASYNC);
|
||||
|
||||
@@ -214,12 +214,19 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev,
|
||||
if (error < 0)
|
||||
goto error_cleanup_resource;
|
||||
|
||||
dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev,
|
||||
&dpmcp_dev->dev,
|
||||
DL_FLAG_AUTOREMOVE_CONSUMER);
|
||||
if (!dpmcp_dev->consumer_link) {
|
||||
error = -EINVAL;
|
||||
goto error_cleanup_mc_io;
|
||||
/* If the DPRC device itself tries to allocate a portal (usually for
|
||||
* UAPI interaction), don't add a device link between them since the
|
||||
* DPMCP device is an actual child device of the DPRC and a reverse
|
||||
* dependency is not allowed.
|
||||
*/
|
||||
if (mc_dev != mc_bus_dev) {
|
||||
dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev,
|
||||
&dpmcp_dev->dev,
|
||||
DL_FLAG_AUTOREMOVE_CONSUMER);
|
||||
if (!dpmcp_dev->consumer_link) {
|
||||
error = -EINVAL;
|
||||
goto error_cleanup_mc_io;
|
||||
}
|
||||
}
|
||||
|
||||
*new_mc_io = mc_io;
|
||||
|
||||
@@ -3907,6 +3907,7 @@ static const struct clk_parent_data spicc_sclk_parent_data[] = {
|
||||
{ .hw = &g12a_clk81.hw },
|
||||
{ .hw = &g12a_fclk_div4.hw },
|
||||
{ .hw = &g12a_fclk_div3.hw },
|
||||
{ .hw = &g12a_fclk_div2.hw },
|
||||
{ .hw = &g12a_fclk_div5.hw },
|
||||
{ .hw = &g12a_fclk_div7.hw },
|
||||
};
|
||||
|
||||
@@ -1704,9 +1704,9 @@ static ssize_t altr_edac_a10_device_trig(struct file *file,
|
||||
|
||||
local_irq_save(flags);
|
||||
if (trig_type == ALTR_UE_TRIGGER_CHAR)
|
||||
writel(priv->ue_set_mask, set_addr);
|
||||
writew(priv->ue_set_mask, set_addr);
|
||||
else
|
||||
writel(priv->ce_set_mask, set_addr);
|
||||
writew(priv->ce_set_mask, set_addr);
|
||||
|
||||
/* Ensure the interrupt test bits are set */
|
||||
wmb();
|
||||
@@ -1736,7 +1736,7 @@ static ssize_t altr_edac_a10_device_trig2(struct file *file,
|
||||
|
||||
local_irq_save(flags);
|
||||
if (trig_type == ALTR_UE_TRIGGER_CHAR) {
|
||||
writel(priv->ue_set_mask, set_addr);
|
||||
writew(priv->ue_set_mask, set_addr);
|
||||
} else {
|
||||
/* Setup read/write of 4 bytes */
|
||||
writel(ECC_WORD_WRITE, drvdata->base + ECC_BLK_DBYTECTRL_OFST);
|
||||
|
||||
@@ -4002,8 +4002,6 @@ static void gfx_v10_0_get_csb_buffer(struct amdgpu_device *adev,
|
||||
PACKET3_SET_CONTEXT_REG_START);
|
||||
for (i = 0; i < ext->reg_count; i++)
|
||||
buffer[count++] = cpu_to_le32(ext->extent[i]);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2896,8 +2896,6 @@ static void gfx_v6_0_get_csb_buffer(struct amdgpu_device *adev,
|
||||
buffer[count++] = cpu_to_le32(ext->reg_index - 0xa000);
|
||||
for (i = 0; i < ext->reg_count; i++)
|
||||
buffer[count++] = cpu_to_le32(ext->extent[i]);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4000,8 +4000,6 @@ static void gfx_v7_0_get_csb_buffer(struct amdgpu_device *adev,
|
||||
buffer[count++] = cpu_to_le32(ext->reg_index - PACKET3_SET_CONTEXT_REG_START);
|
||||
for (i = 0; i < ext->reg_count; i++)
|
||||
buffer[count++] = cpu_to_le32(ext->extent[i]);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8098,16 +8098,20 @@ static int dm_force_atomic_commit(struct drm_connector *connector)
|
||||
*/
|
||||
conn_state = drm_atomic_get_connector_state(state, connector);
|
||||
|
||||
ret = PTR_ERR_OR_ZERO(conn_state);
|
||||
if (ret)
|
||||
/* Check for error in getting connector state */
|
||||
if (IS_ERR(conn_state)) {
|
||||
ret = PTR_ERR(conn_state);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Attach crtc to drm_atomic_state*/
|
||||
crtc_state = drm_atomic_get_crtc_state(state, &disconnected_acrtc->base);
|
||||
|
||||
ret = PTR_ERR_OR_ZERO(crtc_state);
|
||||
if (ret)
|
||||
/* Check for error in getting crtc state */
|
||||
if (IS_ERR(crtc_state)) {
|
||||
ret = PTR_ERR(crtc_state);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* force a restore */
|
||||
crtc_state->mode_changed = true;
|
||||
@@ -8115,9 +8119,11 @@ static int dm_force_atomic_commit(struct drm_connector *connector)
|
||||
/* Attach plane to drm_atomic_state */
|
||||
plane_state = drm_atomic_get_plane_state(state, plane);
|
||||
|
||||
ret = PTR_ERR_OR_ZERO(plane_state);
|
||||
if (ret)
|
||||
/* Check for error in getting plane state */
|
||||
if (IS_ERR(plane_state)) {
|
||||
ret = PTR_ERR(plane_state);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Call commit internally with the state we just constructed */
|
||||
ret = drm_atomic_commit(state);
|
||||
|
||||
@@ -1778,10 +1778,10 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
||||
* that we can get the current state of the GPIO.
|
||||
*/
|
||||
dp->irq = gpiod_to_irq(dp->hpd_gpiod);
|
||||
irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
|
||||
irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN;
|
||||
} else {
|
||||
dp->irq = platform_get_irq(pdev, 0);
|
||||
irq_flags = 0;
|
||||
irq_flags = IRQF_NO_AUTOEN;
|
||||
}
|
||||
|
||||
if (dp->irq == -ENXIO) {
|
||||
@@ -1798,7 +1798,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
||||
dev_err(&pdev->dev, "failed to request irq\n");
|
||||
goto err_disable_clk;
|
||||
}
|
||||
disable_irq(dp->irq);
|
||||
|
||||
return dp;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ static int a6xx_hfi_wait_for_ack(struct a6xx_gmu *gmu, u32 id, u32 seqnum,
|
||||
|
||||
/* Wait for a response */
|
||||
ret = gmu_poll_timeout(gmu, REG_A6XX_GMU_GMU2HOST_INTR_INFO, val,
|
||||
val & A6XX_GMU_GMU2HOST_INTR_INFO_MSGQ, 100, 5000);
|
||||
val & A6XX_GMU_GMU2HOST_INTR_INFO_MSGQ, 100, 1000000);
|
||||
|
||||
if (ret) {
|
||||
DRM_DEV_ERROR(gmu->dev,
|
||||
|
||||
@@ -107,11 +107,15 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c,
|
||||
if (num == 0)
|
||||
return num;
|
||||
|
||||
ret = pm_runtime_resume_and_get(&hdmi->pdev->dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
init_ddc(hdmi_i2c);
|
||||
|
||||
ret = ddc_clear_irq(hdmi_i2c);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto fail;
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
struct i2c_msg *p = &msgs[i];
|
||||
@@ -169,7 +173,7 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c,
|
||||
hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS),
|
||||
hdmi_read(hdmi, REG_HDMI_DDC_HW_STATUS),
|
||||
hdmi_read(hdmi, REG_HDMI_DDC_INT_CTRL));
|
||||
return ret;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ddc_status = hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS);
|
||||
@@ -202,7 +206,13 @@ static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c,
|
||||
}
|
||||
}
|
||||
|
||||
pm_runtime_put(&hdmi->pdev->dev);
|
||||
|
||||
return i;
|
||||
|
||||
fail:
|
||||
pm_runtime_put(&hdmi->pdev->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static u32 msm_hdmi_i2c_func(struct i2c_adapter *adapter)
|
||||
|
||||
@@ -151,7 +151,7 @@ static int ad7606_spi_reg_write(struct ad7606_state *st,
|
||||
struct spi_device *spi = to_spi_device(st->dev);
|
||||
|
||||
st->d16[0] = cpu_to_be16((st->bops->rd_wr_cmd(addr, 1) << 8) |
|
||||
(val & 0x1FF));
|
||||
(val & 0xFF));
|
||||
|
||||
return spi_write(spi, &st->d16[0], sizeof(st->d16[0]));
|
||||
}
|
||||
|
||||
@@ -67,16 +67,18 @@ int inv_icm42600_temp_read_raw(struct iio_dev *indio_dev,
|
||||
return IIO_VAL_INT;
|
||||
/*
|
||||
* T°C = (temp / 132.48) + 25
|
||||
* Tm°C = 1000 * ((temp * 100 / 13248) + 25)
|
||||
* Tm°C = 1000 * ((temp / 132.48) + 25)
|
||||
* Tm°C = 7.548309 * temp + 25000
|
||||
* Tm°C = (temp + 3312) * 7.548309
|
||||
* scale: 100000 / 13248 ~= 7.548309
|
||||
* offset: 25000
|
||||
* offset: 3312
|
||||
*/
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
*val = 7;
|
||||
*val2 = 548309;
|
||||
return IIO_VAL_INT_PLUS_MICRO;
|
||||
case IIO_CHAN_INFO_OFFSET:
|
||||
*val = 25000;
|
||||
*val = 3312;
|
||||
return IIO_VAL_INT;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -845,6 +845,12 @@ static int ims_pcu_flash_firmware(struct ims_pcu *pcu,
|
||||
addr = be32_to_cpu(rec->addr) / 2;
|
||||
len = be16_to_cpu(rec->len);
|
||||
|
||||
if (len > sizeof(pcu->cmd_buf) - 1 - sizeof(*fragment)) {
|
||||
dev_err(pcu->dev,
|
||||
"Invalid record length in firmware: %d\n", len);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
fragment = (void *)&pcu->cmd_buf[1];
|
||||
put_unaligned_le32(addr, &fragment->addr);
|
||||
fragment->len = len;
|
||||
|
||||
@@ -128,10 +128,9 @@ static void queue_bio(struct mirror_set *ms, struct bio *bio, int rw)
|
||||
spin_lock_irqsave(&ms->lock, flags);
|
||||
should_wake = !(bl->head);
|
||||
bio_list_add(bl, bio);
|
||||
spin_unlock_irqrestore(&ms->lock, flags);
|
||||
|
||||
if (should_wake)
|
||||
wakeup_mirrord(ms);
|
||||
spin_unlock_irqrestore(&ms->lock, flags);
|
||||
}
|
||||
|
||||
static void dispatch_bios(void *context, struct bio_list *bio_list)
|
||||
@@ -638,9 +637,9 @@ static void write_callback(unsigned long error, void *context)
|
||||
if (!ms->failures.head)
|
||||
should_wake = 1;
|
||||
bio_list_add(&ms->failures, bio);
|
||||
spin_unlock_irqrestore(&ms->lock, flags);
|
||||
if (should_wake)
|
||||
wakeup_mirrord(ms);
|
||||
spin_unlock_irqrestore(&ms->lock, flags);
|
||||
}
|
||||
|
||||
static void do_write(struct mirror_set *ms, struct bio *bio)
|
||||
|
||||
@@ -818,6 +818,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct nand_chip *nand,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
sunxi_nfc_randomizer_config(nand, page, false);
|
||||
sunxi_nfc_randomizer_enable(nand);
|
||||
writel(NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD | NFC_ECC_OP,
|
||||
nfc->regs + NFC_REG_CMD);
|
||||
@@ -1045,6 +1046,7 @@ static int sunxi_nfc_hw_ecc_write_chunk(struct nand_chip *nand,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
sunxi_nfc_randomizer_config(nand, page, false);
|
||||
sunxi_nfc_randomizer_enable(nand);
|
||||
sunxi_nfc_hw_ecc_set_prot_oob_bytes(nand, oob, 0, bbm, page);
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ static int ch9200_mdio_read(struct net_device *netdev, int phy_id, int loc)
|
||||
{
|
||||
struct usbnet *dev = netdev_priv(netdev);
|
||||
unsigned char buff[2];
|
||||
int ret;
|
||||
|
||||
netdev_dbg(netdev, "%s phy_id:%02x loc:%02x\n",
|
||||
__func__, phy_id, loc);
|
||||
@@ -185,8 +186,10 @@ static int ch9200_mdio_read(struct net_device *netdev, int phy_id, int loc)
|
||||
if (phy_id != 0)
|
||||
return -ENODEV;
|
||||
|
||||
control_read(dev, REQUEST_READ, 0, loc * 2, buff, 0x02,
|
||||
CONTROL_TIMEOUT_MS);
|
||||
ret = control_read(dev, REQUEST_READ, 0, loc * 2, buff, 0x02,
|
||||
CONTROL_TIMEOUT_MS);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return (buff[0] | buff[1] << 8);
|
||||
}
|
||||
|
||||
@@ -5365,7 +5365,8 @@ static void pci_slot_unlock(struct pci_slot *slot)
|
||||
continue;
|
||||
if (dev->subordinate)
|
||||
pci_bus_unlock(dev->subordinate);
|
||||
pci_dev_unlock(dev);
|
||||
else
|
||||
pci_dev_unlock(dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4827,6 +4827,18 @@ static int pci_quirk_brcm_acs(struct pci_dev *dev, u16 acs_flags)
|
||||
PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
|
||||
}
|
||||
|
||||
static int pci_quirk_loongson_acs(struct pci_dev *dev, u16 acs_flags)
|
||||
{
|
||||
/*
|
||||
* Loongson PCIe Root Ports don't advertise an ACS capability, but
|
||||
* they do not allow peer-to-peer transactions between Root Ports.
|
||||
* Allow each Root Port to be in a separate IOMMU group by masking
|
||||
* SV/RR/CR/UF bits.
|
||||
*/
|
||||
return pci_acs_ctrl_enabled(acs_flags,
|
||||
PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
|
||||
}
|
||||
|
||||
/*
|
||||
* Wangxun 40G/25G/10G/1G NICs have no ACS capability, but on
|
||||
* multi-function devices, the hardware isolates the functions by
|
||||
@@ -4960,6 +4972,17 @@ static const struct pci_dev_acs_enabled {
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0x1762, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0x1763, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0xD714, pci_quirk_brcm_acs },
|
||||
/* Loongson PCIe Root Ports */
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x3C09, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x3C19, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x3C29, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x7A09, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x7A19, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x7A29, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x7A39, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x7A49, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x7A59, pci_quirk_loongson_acs },
|
||||
{ PCI_VENDOR_ID_LOONGSON, 0x7A69, pci_quirk_loongson_acs },
|
||||
/* Amazon Annapurna Labs */
|
||||
{ PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031, pci_quirk_al_acs },
|
||||
/* Zhaoxin multi-function devices */
|
||||
|
||||
@@ -2000,7 +2000,7 @@ static int bq27xxx_battery_get_property(struct power_supply *psy,
|
||||
mutex_unlock(&di->lock);
|
||||
|
||||
if (psp != POWER_SUPPLY_PROP_PRESENT && di->cache.flags < 0)
|
||||
return -ENODEV;
|
||||
return di->cache.flags;
|
||||
|
||||
switch (psp) {
|
||||
case POWER_SUPPLY_PROP_STATUS:
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Andrew F. Davis <afd@ti.com>
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
@@ -32,6 +33,7 @@ static int bq27xxx_battery_i2c_read(struct bq27xxx_device_info *di, u8 reg,
|
||||
struct i2c_msg msg[2];
|
||||
u8 data[2];
|
||||
int ret;
|
||||
int retry = 0;
|
||||
|
||||
if (!client->adapter)
|
||||
return -ENODEV;
|
||||
@@ -48,7 +50,16 @@ static int bq27xxx_battery_i2c_read(struct bq27xxx_device_info *di, u8 reg,
|
||||
else
|
||||
msg[1].len = 2;
|
||||
|
||||
ret = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
|
||||
do {
|
||||
ret = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
|
||||
if (ret == -EBUSY && ++retry < 3) {
|
||||
/* sleep 10 milliseconds when busy */
|
||||
usleep_range(10000, 11000);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -40,11 +40,14 @@ static int max14577_reg_get_current_limit(struct regulator_dev *rdev)
|
||||
struct max14577 *max14577 = rdev_get_drvdata(rdev);
|
||||
const struct maxim_charger_current *limits =
|
||||
&maxim_charger_currents[max14577->dev_type];
|
||||
int ret;
|
||||
|
||||
if (rdev_get_id(rdev) != MAX14577_CHARGER)
|
||||
return -EINVAL;
|
||||
|
||||
max14577_read_reg(rmap, MAX14577_CHG_REG_CHG_CTRL4, ®_data);
|
||||
ret = max14577_read_reg(rmap, MAX14577_CHG_REG_CHG_CTRL4, ®_data);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if ((reg_data & CHGCTRL4_MBCICHWRCL_MASK) == 0)
|
||||
return limits->min;
|
||||
|
||||
@@ -412,7 +412,7 @@ static ssize_t ad5933_store(struct device *dev,
|
||||
ret = ad5933_cmd(st, 0);
|
||||
break;
|
||||
case AD5933_OUT_SETTLING_CYCLES:
|
||||
val = clamp(val, (u16)0, (u16)0x7FF);
|
||||
val = clamp(val, (u16)0, (u16)0x7FC);
|
||||
st->settling_cycles = val;
|
||||
|
||||
/* 2x, 4x handling, see datasheet */
|
||||
|
||||
@@ -288,13 +288,13 @@ hv_uio_probe(struct hv_device *dev,
|
||||
pdata->info.mem[INT_PAGE_MAP].name = "int_page";
|
||||
pdata->info.mem[INT_PAGE_MAP].addr
|
||||
= (uintptr_t)vmbus_connection.int_page;
|
||||
pdata->info.mem[INT_PAGE_MAP].size = PAGE_SIZE;
|
||||
pdata->info.mem[INT_PAGE_MAP].size = HV_HYP_PAGE_SIZE;
|
||||
pdata->info.mem[INT_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
|
||||
|
||||
pdata->info.mem[MON_PAGE_MAP].name = "monitor_page";
|
||||
pdata->info.mem[MON_PAGE_MAP].addr
|
||||
= (uintptr_t)vmbus_connection.monitor_pages[1];
|
||||
pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
|
||||
pdata->info.mem[MON_PAGE_MAP].size = HV_HYP_PAGE_SIZE;
|
||||
pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
|
||||
|
||||
pdata->recv_buf = vzalloc(RECV_BUFFER_SIZE);
|
||||
|
||||
@@ -1200,7 +1200,7 @@ static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
|
||||
c->vc_screenbuf_size - delta);
|
||||
c->vc_origin = vga_vram_end - c->vc_screenbuf_size;
|
||||
vga_rolled_over = 0;
|
||||
} else
|
||||
} else if (oldo - delta >= (unsigned long)c->vc_screenbuf)
|
||||
c->vc_origin -= delta;
|
||||
c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size;
|
||||
scr_memsetw((u16 *) (c->vc_origin), c->vc_video_erase_char,
|
||||
|
||||
@@ -1062,8 +1062,10 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
|
||||
!list_empty(&info->modelist))
|
||||
ret = fb_add_videomode(&mode, &info->modelist);
|
||||
|
||||
if (ret)
|
||||
if (ret) {
|
||||
info->var = old_var;
|
||||
return ret;
|
||||
}
|
||||
|
||||
event.info = info;
|
||||
event.data = &mode;
|
||||
|
||||
@@ -804,4 +804,5 @@ load_default:
|
||||
void exfat_free_upcase_table(struct exfat_sb_info *sbi)
|
||||
{
|
||||
kvfree(sbi->vol_utbl);
|
||||
sbi->vol_utbl = NULL;
|
||||
}
|
||||
|
||||
@@ -3275,6 +3275,13 @@ static inline unsigned int ext4_flex_bg_size(struct ext4_sb_info *sbi)
|
||||
return 1 << sbi->s_log_groups_per_flex;
|
||||
}
|
||||
|
||||
static inline loff_t ext4_get_maxbytes(struct inode *inode)
|
||||
{
|
||||
if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
|
||||
return inode->i_sb->s_maxbytes;
|
||||
return EXT4_SB(inode->i_sb)->s_bitmap_maxbytes;
|
||||
}
|
||||
|
||||
#define ext4_std_error(sb, errno) \
|
||||
do { \
|
||||
if ((errno)) \
|
||||
|
||||
@@ -2367,18 +2367,19 @@ int ext4_ext_calc_credits_for_single_extent(struct inode *inode, int nrblocks,
|
||||
int ext4_ext_index_trans_blocks(struct inode *inode, int extents)
|
||||
{
|
||||
int index;
|
||||
int depth;
|
||||
|
||||
/* If we are converting the inline data, only one is needed here. */
|
||||
if (ext4_has_inline_data(inode))
|
||||
return 1;
|
||||
|
||||
depth = ext_depth(inode);
|
||||
|
||||
/*
|
||||
* Extent tree can change between the time we estimate credits and
|
||||
* the time we actually modify the tree. Assume the worst case.
|
||||
*/
|
||||
if (extents <= 1)
|
||||
index = depth * 2;
|
||||
index = EXT4_MAX_EXTENT_DEPTH * 2;
|
||||
else
|
||||
index = depth * 3;
|
||||
index = EXT4_MAX_EXTENT_DEPTH * 3;
|
||||
|
||||
return index;
|
||||
}
|
||||
@@ -4969,12 +4970,7 @@ static const struct iomap_ops ext4_iomap_xattr_ops = {
|
||||
|
||||
static int ext4_fiemap_check_ranges(struct inode *inode, u64 start, u64 *len)
|
||||
{
|
||||
u64 maxbytes;
|
||||
|
||||
if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
|
||||
maxbytes = inode->i_sb->s_maxbytes;
|
||||
else
|
||||
maxbytes = EXT4_SB(inode->i_sb)->s_bitmap_maxbytes;
|
||||
u64 maxbytes = ext4_get_maxbytes(inode);
|
||||
|
||||
if (*len == 0)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -884,12 +884,7 @@ static int ext4_file_open(struct inode *inode, struct file *filp)
|
||||
loff_t ext4_llseek(struct file *file, loff_t offset, int whence)
|
||||
{
|
||||
struct inode *inode = file->f_mapping->host;
|
||||
loff_t maxbytes;
|
||||
|
||||
if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
|
||||
maxbytes = EXT4_SB(inode->i_sb)->s_bitmap_maxbytes;
|
||||
else
|
||||
maxbytes = inode->i_sb->s_maxbytes;
|
||||
loff_t maxbytes = ext4_get_maxbytes(inode);
|
||||
|
||||
switch (whence) {
|
||||
default:
|
||||
|
||||
@@ -390,7 +390,7 @@ out:
|
||||
}
|
||||
|
||||
static int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
|
||||
unsigned int len)
|
||||
loff_t len)
|
||||
{
|
||||
int ret, size, no_expand;
|
||||
struct ext4_inode_info *ei = EXT4_I(inode);
|
||||
|
||||
@@ -4900,7 +4900,8 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
|
||||
ei->i_file_acl |=
|
||||
((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32;
|
||||
inode->i_size = ext4_isize(sb, raw_inode);
|
||||
if ((size = i_size_read(inode)) < 0) {
|
||||
size = i_size_read(inode);
|
||||
if (size < 0 || size > ext4_get_maxbytes(inode)) {
|
||||
ext4_error_inode(inode, function, line, 0,
|
||||
"iget: bad i_size value: %lld", size);
|
||||
ret = -EFSCORRUPTED;
|
||||
|
||||
@@ -608,6 +608,15 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (unlikely(inode->i_nlink == 0)) {
|
||||
f2fs_warn(F2FS_I_SB(inode), "%s: inode (ino=%lx) has zero i_nlink",
|
||||
__func__, inode->i_ino);
|
||||
err = -EFSCORRUPTED;
|
||||
set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK);
|
||||
f2fs_put_page(page, 0);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
f2fs_balance_fs(sbi, true);
|
||||
|
||||
f2fs_lock_op(sbi);
|
||||
|
||||
@@ -3289,6 +3289,7 @@ int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi)
|
||||
block_t user_block_count, valid_user_blocks;
|
||||
block_t avail_node_count, valid_node_count;
|
||||
unsigned int nat_blocks, nat_bits_bytes, nat_bits_blocks;
|
||||
unsigned int sit_blk_cnt;
|
||||
int i, j;
|
||||
|
||||
total = le32_to_cpu(raw_super->segment_count);
|
||||
@@ -3400,6 +3401,13 @@ skip_cross:
|
||||
return 1;
|
||||
}
|
||||
|
||||
sit_blk_cnt = DIV_ROUND_UP(main_segs, SIT_ENTRY_PER_BLOCK);
|
||||
if (sit_bitmap_size * 8 < sit_blk_cnt) {
|
||||
f2fs_err(sbi, "Wrong bitmap size: sit: %u, sit_blk_cnt:%u",
|
||||
sit_bitmap_size, sit_blk_cnt);
|
||||
return 1;
|
||||
}
|
||||
|
||||
cp_pack_start_sum = __start_sum_addr(sbi);
|
||||
cp_payload = __cp_payload(sbi);
|
||||
if (cp_pack_start_sum < cp_payload + 1 ||
|
||||
|
||||
@@ -524,7 +524,7 @@ typedef u64 acpi_integer;
|
||||
|
||||
/* Support for the special RSDP signature (8 characters) */
|
||||
|
||||
#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
|
||||
#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, (sizeof(a) < 8) ? ACPI_NAMESEG_SIZE : 8))
|
||||
#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
|
||||
|
||||
/* Support for OEMx signature (x can be any character) */
|
||||
|
||||
@@ -153,10 +153,18 @@ enum v4l2_buf_type {
|
||||
V4L2_BUF_TYPE_SDR_OUTPUT = 12,
|
||||
V4L2_BUF_TYPE_META_CAPTURE = 13,
|
||||
V4L2_BUF_TYPE_META_OUTPUT = 14,
|
||||
/*
|
||||
* Note: V4L2_TYPE_IS_VALID and V4L2_TYPE_IS_OUTPUT must
|
||||
* be updated if a new type is added.
|
||||
*/
|
||||
/* Deprecated, do not use */
|
||||
V4L2_BUF_TYPE_PRIVATE = 0x80,
|
||||
};
|
||||
|
||||
#define V4L2_TYPE_IS_VALID(type) \
|
||||
((type) >= V4L2_BUF_TYPE_VIDEO_CAPTURE &&\
|
||||
(type) <= V4L2_BUF_TYPE_META_OUTPUT)
|
||||
|
||||
#define V4L2_TYPE_IS_MULTIPLANAR(type) \
|
||||
((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
|
||||
|| (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
|
||||
@@ -164,14 +172,14 @@ enum v4l2_buf_type {
|
||||
#define V4L2_TYPE_IS_OUTPUT(type) \
|
||||
((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
|
||||
|| (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
|
||||
|| (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
|
||||
|| (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
|
||||
|| (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
|
||||
|| (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \
|
||||
|| (type) == V4L2_BUF_TYPE_SDR_OUTPUT \
|
||||
|| (type) == V4L2_BUF_TYPE_META_OUTPUT)
|
||||
|
||||
#define V4L2_TYPE_IS_CAPTURE(type) (!V4L2_TYPE_IS_OUTPUT(type))
|
||||
#define V4L2_TYPE_IS_CAPTURE(type) \
|
||||
(V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type))
|
||||
|
||||
enum v4l2_tuner_type {
|
||||
V4L2_TUNER_RADIO = 1,
|
||||
|
||||
@@ -417,8 +417,11 @@ static int shm_try_destroy_orphaned(int id, void *p, void *data)
|
||||
void shm_destroy_orphaned(struct ipc_namespace *ns)
|
||||
{
|
||||
down_write(&shm_ids(ns).rwsem);
|
||||
if (shm_ids(ns).in_use)
|
||||
if (shm_ids(ns).in_use) {
|
||||
rcu_read_lock();
|
||||
idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_orphaned, ns);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
up_write(&shm_ids(ns).rwsem);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ static void clocksource_verify_choose_cpus(void)
|
||||
{
|
||||
int cpu, i, n = verify_n_cpus;
|
||||
|
||||
if (n < 0) {
|
||||
if (n < 0 || n >= num_online_cpus()) {
|
||||
/* Check all of the CPUs. */
|
||||
cpumask_copy(&cpus_chosen, cpu_online_mask);
|
||||
cpumask_clear_cpu(smp_processor_id(), &cpus_chosen);
|
||||
|
||||
@@ -6474,9 +6474,10 @@ void ftrace_release_mod(struct module *mod)
|
||||
|
||||
mutex_lock(&ftrace_lock);
|
||||
|
||||
if (ftrace_disabled)
|
||||
goto out_unlock;
|
||||
|
||||
/*
|
||||
* To avoid the UAF problem after the module is unloaded, the
|
||||
* 'mod_map' resource needs to be released unconditionally.
|
||||
*/
|
||||
list_for_each_entry_safe(mod_map, n, &ftrace_mod_maps, list) {
|
||||
if (mod_map->mod == mod) {
|
||||
list_del_rcu(&mod_map->list);
|
||||
@@ -6485,6 +6486,9 @@ void ftrace_release_mod(struct module *mod)
|
||||
}
|
||||
}
|
||||
|
||||
if (ftrace_disabled)
|
||||
goto out_unlock;
|
||||
|
||||
/*
|
||||
* Each module has its own ftrace_pages, remove
|
||||
* them from the list.
|
||||
|
||||
@@ -560,8 +560,8 @@ int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
|
||||
|
||||
ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
|
||||
if (ret == 0 && write && vm_dirty_ratio != old_ratio) {
|
||||
writeback_set_ratelimit();
|
||||
vm_dirty_bytes = 0;
|
||||
writeback_set_ratelimit();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -131,22 +131,22 @@ static int nci_uart_set_driver(struct tty_struct *tty, unsigned int driver)
|
||||
|
||||
memcpy(nu, nci_uart_drivers[driver], sizeof(struct nci_uart));
|
||||
nu->tty = tty;
|
||||
tty->disc_data = nu;
|
||||
skb_queue_head_init(&nu->tx_q);
|
||||
INIT_WORK(&nu->write_work, nci_uart_write_work);
|
||||
spin_lock_init(&nu->rx_lock);
|
||||
|
||||
ret = nu->ops.open(nu);
|
||||
if (ret) {
|
||||
tty->disc_data = NULL;
|
||||
kfree(nu);
|
||||
return ret;
|
||||
} else if (!try_module_get(nu->owner)) {
|
||||
nu->ops.close(nu);
|
||||
tty->disc_data = NULL;
|
||||
kfree(nu);
|
||||
return -ENOENT;
|
||||
}
|
||||
return ret;
|
||||
tty->disc_data = nu;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------ LDISC part ------ */
|
||||
|
||||
@@ -133,6 +133,8 @@ static struct cache_head *sunrpc_cache_add_entry(struct cache_detail *detail,
|
||||
|
||||
hlist_add_head_rcu(&new->cache_list, head);
|
||||
detail->entries++;
|
||||
if (detail->nextcheck > new->expiry_time)
|
||||
detail->nextcheck = new->expiry_time + 1;
|
||||
cache_get(new);
|
||||
spin_unlock(&detail->hash_lock);
|
||||
|
||||
|
||||
@@ -158,11 +158,37 @@ static const struct snd_kcontrol_new isense_switch =
|
||||
static const struct snd_kcontrol_new vsense_switch =
|
||||
SOC_DAPM_SINGLE("Switch", TAS2770_PWR_CTRL, 2, 1, 1);
|
||||
|
||||
static int sense_event(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
|
||||
struct tas2770_priv *tas2770 = snd_soc_component_get_drvdata(component);
|
||||
|
||||
/*
|
||||
* Powering up ISENSE/VSENSE requires a trip through the shutdown state.
|
||||
* Do that here to ensure that our changes are applied properly, otherwise
|
||||
* we might end up with non-functional IVSENSE if playback started earlier,
|
||||
* which would break software speaker protection.
|
||||
*/
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_REG:
|
||||
return snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
|
||||
TAS2770_PWR_CTRL_MASK,
|
||||
TAS2770_PWR_CTRL_SHUTDOWN);
|
||||
case SND_SOC_DAPM_POST_REG:
|
||||
return tas2770_update_pwr_ctrl(tas2770);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct snd_soc_dapm_widget tas2770_dapm_widgets[] = {
|
||||
SND_SOC_DAPM_AIF_IN("ASI1", "ASI1 Playback", 0, SND_SOC_NOPM, 0, 0),
|
||||
SND_SOC_DAPM_MUX("ASI1 Sel", SND_SOC_NOPM, 0, 0, &tas2770_asi1_mux),
|
||||
SND_SOC_DAPM_SWITCH("ISENSE", TAS2770_PWR_CTRL, 3, 1, &isense_switch),
|
||||
SND_SOC_DAPM_SWITCH("VSENSE", TAS2770_PWR_CTRL, 2, 1, &vsense_switch),
|
||||
SND_SOC_DAPM_SWITCH_E("ISENSE", TAS2770_PWR_CTRL, 3, 1, &isense_switch,
|
||||
sense_event, SND_SOC_DAPM_PRE_REG | SND_SOC_DAPM_POST_REG),
|
||||
SND_SOC_DAPM_SWITCH_E("VSENSE", TAS2770_PWR_CTRL, 2, 1, &vsense_switch,
|
||||
sense_event, SND_SOC_DAPM_PRE_REG | SND_SOC_DAPM_POST_REG),
|
||||
SND_SOC_DAPM_DAC_E("DAC", NULL, SND_SOC_NOPM, 0, 0, tas2770_dac_event,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
|
||||
SND_SOC_DAPM_OUTPUT("OUT"),
|
||||
|
||||
@@ -607,6 +607,8 @@ static int tegra_ahub_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
ahub->soc_data = of_device_get_match_data(&pdev->dev);
|
||||
if (!ahub->soc_data)
|
||||
return -ENODEV;
|
||||
|
||||
platform_set_drvdata(pdev, ahub);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user