diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-06-14 11:22:38 -0700 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2016-06-14 11:22:38 -0700 |
| commit | f89e635bb12882f4c09f9d57fa0aec08c9207064 (patch) | |
| tree | 18e559620f21f68657a07fba92a5b984c1a02f94 | |
| parent | 5ec373331d6321fa6175c71039eb5d57a749b0d8 (diff) | |
| parent | 07ab290b8a4948ea6607726e03f10691fd36c4e6 (diff) | |
Promotion of kernel.lnx.4.4-160613.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
1027269 I15edfdf0442e3ac678c70df29482b3304cf1215a mmc: sdhci: add a quirk to define non standard tuning
1013280 I5af41bef6db6af14d53018caef1f7fd9b00fc136 ASoC: wcd9335: Avoid TX mute during voice call on headse
1027456 Id281b6b8ac3c9312848c39e11019284f970caced arm: cpu: read all address cells in dt for cpuid
1019254 Ie57950e0fb979807ef95cf21046c97617e286ed0 ASoC: msmcobalt: Create pinctrl entries for ground/mic s
1027647 I7a4ad3188f7a19427c096a596a502debdc2aac55 msm: mdss: add validation for dest scaler count
1027269 I32b8c1bbbd67b4daadaa85c3c01beab8ff1b7cb2 mmc: mmc: Add clk_hold/release pair before caching host-
1027269 If6261c0e42178d331184ac605c192d48a76e1e29 mmc: mmc: fix issue with clock scaling in HS200 mode
1027269 Ie0c11743fb781e765c926e3408b87eaf94dc2eb6 Revert "mmc: sdhci: Panic after dumping SDHC registers"
1027269 I5182b48523e7f9511265fa557433b88224318a23 mmc: sdhci: update sdhci_cmdq_set_transfer_params()
1000387 1027269 Iec6ecef1bf940e720c871be58b265394904f0cf1 drivers: mmc: fix issue raised by source code analyzer t
1027269 I9657b16954b54c491fa19f9d82d9141edf45e0ef mmc: cmdq_hci: set block size as part of CQ unhalt proce
955531 I6bfcfd54525fa6472bd848d4c112fff0c9462355 usb: hcd: Fix double free with bandwidth_mutex on cable
1027269 Ie3917ac9b573dfef514f82e5073d1c480cd9a71d mmc: cmdq_hci: disable CDR in CQ mode
1027461 I10f3c6d1e2d3c6e71be04e3206273aad7971a6b5 diag: dci: Fix possible race condition during SSR
1022917 I6e1bd314af1311af73704bdfd9cdc5d2cb849557 ASoC: msm: Add 48KHz sample rate support for CPE CPU DAI
1025296 Id0e48b5c2f9deea93c5875c10d5ec72bd360df5f mm: fix cma accounting in zone_watermark_ok
1027269 I1d683c4202ce34edeb6cb36d9713e226bb6f43d7 mmc: core: Add NULL check for host->card
1017287 I40e12b9ce8d6751c0a6dc0bd3c780b92c499b7dc drivers: mfd: Set ANC gain register as volatile
1019254 Ibccddc82b18614ddbe6ef9c9720b3de1ce00163e ASoC: msmcobalt: Switch ground/mic swap GPIO control to
1027269 I8dbec823938525af90fb990db1bb4b325ee23cba mmc: sdhci-msm: use PIO for tuning commands
1027269 Id6f6230520db1ad018c883cb639fe66b4b86c70c mmc: sdhci-msm: enable quirk to define non standard tuni
1027269 Id9625167d7e235fb3a20a6193889c1654b5c0cd8 mmc: sdhci: Add new quirk to use PIO for eMMC tuning com
1018329 I716401adda144ac0c03520f747694eaa50ea8e51 soundwire: Fix NULL pointer dereference
1027269 If502f28e19924264dfb99d76f6881d3167f56a05 mmc: core: modify scaling up/down sequence
1027269 I1e5cbb6a2dfff129acdb27e27ea090d58197f41c mmc: core: Fix the timing related checks in partial_init
1013573 I113657c91dd5eb00791535dc78b7cdad1db5c4aa ASoC: wcd9330: Fix MCLK enable/disable issue in wcd9330
1027269 Ic90fe26a676ae7dd2063e17bc3771db83605f4dc mmc: core: fix reading the bkops status from card
1027269 Idaa2cb0c7712846f6827272caefc112b127ef818 mmc: sdhci: Implement set_transfer_params() cmdq host op
1027269 I3a9856e0d60ce6a9cc1727cd8ccd10ef33bb707c mmc: cmdq_hci: add set_transfer_params() to CQ unhalt
1027269 I69f9dacaa042e9f9a0bc4ed886f97c5c4a3b9791 mmc: sdhci-msm: Don't enable MMC_CAP2_FULL_PWR_CYCLE
Change-Id: I0a671106a0593c7889c9ee403bc8a87e4c9a490e
CRs-Fixed: 1025296, 1013280, 1013573, 955531, 1000387, 1017287, 1019254, 1022917, 1027647, 1027456, 1027461, 1018329, 1027269
26 files changed, 230 insertions, 57 deletions
diff --git a/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt b/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt index ca8f6142d3e5..ff31419c5814 100755 --- a/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt +++ b/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt @@ -336,6 +336,12 @@ Required properties: - compatible : "qcom,msm-cpe-lsm" +* wcd_us_euro_gpio + +Required properties: + + - compatible : "qcom,msm-cdc-pinctrl" + * msm-dai-slim Required properties: diff --git a/arch/arm/boot/dts/qcom/msmcobalt-audio.dtsi b/arch/arm/boot/dts/qcom/msmcobalt-audio.dtsi index 62ebcd7acbc5..089b00ac7a4e 100644 --- a/arch/arm/boot/dts/qcom/msmcobalt-audio.dtsi +++ b/arch/arm/boot/dts/qcom/msmcobalt-audio.dtsi @@ -62,6 +62,7 @@ qcom,msm-mbhc-hphl-swh = <0>; qcom,msm-mbhc-gnd-swh = <0>; + qcom,us-euro-gpios = <&wcd_us_euro_gpio>; qcom,tasha-mclk-clk-freq = <9600000>; asoc-platform = <&pcm0>, <&pcm1>, <&pcm2>, <&voip>, <&voice>, <&loopback>, <&compress>, <&hostless>, @@ -110,6 +111,13 @@ compatible = "qcom,msm-cpe-lsm"; }; + wcd_us_euro_gpio: msm_cdc_pinctrl@75 { + compatible = "qcom,msm-cdc-pinctrl"; + pinctrl-names = "aud_active", "aud_sleep"; + pinctrl-0 = <&wcd_gnd_mic_swap_active>; + pinctrl-1 = <&wcd_gnd_mic_swap_idle>; + }; + wcd9xxx_intc: wcd9xxx-irq { status = "ok"; compatible = "qcom,wcd9xxx-irq"; diff --git a/arch/arm/boot/dts/qcom/msmcobalt-pinctrl.dtsi b/arch/arm/boot/dts/qcom/msmcobalt-pinctrl.dtsi index c4e7e03a91f4..3d58795eef5b 100644 --- a/arch/arm/boot/dts/qcom/msmcobalt-pinctrl.dtsi +++ b/arch/arm/boot/dts/qcom/msmcobalt-pinctrl.dtsi @@ -587,6 +587,34 @@ }; }; + wcd_gnd_mic_swap { + wcd_gnd_mic_swap_idle: wcd_gnd_mic_swap_idle { + mux { + pins = "gpio75"; + function = "gpio"; + }; + config { + pins = "gpio75"; + drive-strength = <2>; + bias-pull-down; + output-low; + }; + }; + wcd_gnd_mic_swap_active: wcd_gnd_mic_swap_active { + mux { + pins = "gpio75"; + function = "gpio"; + }; + config { + pins = "gpio75"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + }; + + cdc_reset_ctrl { cdc_reset_sleep: cdc_reset_sleep { mux { diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index 65addcbf5b30..e94422d0405c 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -88,6 +88,7 @@ void __init arm_dt_init_cpu_maps(void) for_each_child_of_node(cpus, cpu) { u32 hwid; + const __be32 *cell; if (of_node_cmp(cpu->type, "cpu")) continue; @@ -98,13 +99,13 @@ void __init arm_dt_init_cpu_maps(void) * properties is considered invalid to build the * cpu_logical_map. */ - if (of_property_read_u32(cpu, "reg", &hwid)) { - pr_debug(" * %s missing reg property\n", - cpu->full_name); + cell = of_get_property(cpu, "reg", NULL); + if (!cell) { + pr_err("%s: missing reg property\n", cpu->full_name); of_node_put(cpu); return; } - + hwid = of_read_number(cell, of_n_addr_cells(cpu)); /* * 8 MSBs must be set to 0 in the DT since the reg property * defines the MPIDR[23:0]. diff --git a/drivers/char/diag/diag_dci.c b/drivers/char/diag/diag_dci.c index 1000b2595a83..b830334dc701 100644 --- a/drivers/char/diag/diag_dci.c +++ b/drivers/char/diag/diag_dci.c @@ -2964,7 +2964,6 @@ int diag_dci_deinit_client(struct diag_dci_client_tbl *entry) diag_update_userspace_clients(DCI_LOG_MASKS_TYPE); ret = dci_ops_tbl[token].send_log_mask(token); if (ret != DIAG_DCI_NO_ERROR) { - mutex_unlock(&driver->dci_mutex); return ret; } kfree(entry->dci_event_mask); @@ -2973,7 +2972,6 @@ int diag_dci_deinit_client(struct diag_dci_client_tbl *entry) diag_update_userspace_clients(DCI_EVENT_MASKS_TYPE); ret = dci_ops_tbl[token].send_event_mask(token); if (ret != DIAG_DCI_NO_ERROR) { - mutex_unlock(&driver->dci_mutex); return ret; } diff --git a/drivers/mfd/msm-cdc-pinctrl.c b/drivers/mfd/msm-cdc-pinctrl.c index 5f5c3692e9c4..a19e3a536950 100644 --- a/drivers/mfd/msm-cdc-pinctrl.c +++ b/drivers/mfd/msm-cdc-pinctrl.c @@ -25,6 +25,7 @@ struct msm_cdc_pinctrl_info { struct pinctrl *pinctrl; struct pinctrl_state *pinctrl_active; struct pinctrl_state *pinctrl_sleep; + bool state; }; static struct msm_cdc_pinctrl_info *msm_cdc_pinctrl_get_gpiodata( @@ -70,6 +71,7 @@ int msm_cdc_pinctrl_select_sleep_state(struct device_node *np) pr_err("%s: pinctrl sleep state is null\n", __func__); return -EINVAL; } + gpio_data->state = false; return pinctrl_select_state(gpio_data->pinctrl, gpio_data->pinctrl_sleep); @@ -94,12 +96,31 @@ int msm_cdc_pinctrl_select_active_state(struct device_node *np) pr_err("%s: pinctrl active state is null\n", __func__); return -EINVAL; } + gpio_data->state = true; return pinctrl_select_state(gpio_data->pinctrl, gpio_data->pinctrl_active); } EXPORT_SYMBOL(msm_cdc_pinctrl_select_active_state); +/* + * msm_cdc_pinctrl_get_state: get curren pinctrl state + * @np: pointer to struct device_node + * + * Returns 0 for sleep state, 1 for active state + */ +bool msm_cdc_pinctrl_get_state(struct device_node *np) +{ + struct msm_cdc_pinctrl_info *gpio_data; + + gpio_data = msm_cdc_pinctrl_get_gpiodata(np); + if (!gpio_data) + return -EINVAL; + + return gpio_data->state; +} +EXPORT_SYMBOL(msm_cdc_pinctrl_get_state); + static int msm_cdc_pinctrl_probe(struct platform_device *pdev) { int ret = 0; diff --git a/drivers/mfd/wcd9335-regmap.c b/drivers/mfd/wcd9335-regmap.c index 851156f0e34b..e2a5028cb8d2 100644 --- a/drivers/mfd/wcd9335-regmap.c +++ b/drivers/mfd/wcd9335-regmap.c @@ -1517,11 +1517,11 @@ static bool wcd9335_is_volatile_register(struct device *dev, unsigned int reg) return true; if ((reg >= WCD9335_CDC_ANC0_IIR_COEFF_1_CTL) && - (reg <= WCD9335_CDC_ANC0_IIR_COEFF_2_CTL)) + (reg <= WCD9335_CDC_ANC0_FB_GAIN_CTL)) return true; if ((reg >= WCD9335_CDC_ANC1_IIR_COEFF_1_CTL) && - (reg <= WCD9335_CDC_ANC1_IIR_COEFF_2_CTL)) + (reg <= WCD9335_CDC_ANC1_FB_GAIN_CTL)) return true; /* * CPE inbox and outbox registers are volatile diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 2197e2495b88..add448035213 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1871,8 +1871,14 @@ int mmc_read_bkops_status(struct mmc_card *card) if (err) return err; - card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS]; - card->ext_csd.raw_exception_status = ext_csd[EXT_CSD_EXP_EVENTS_STATUS]; + card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS] & + MMC_BKOPS_URGENCY_MASK; + card->ext_csd.raw_exception_status = + ext_csd[EXT_CSD_EXP_EVENTS_STATUS] & (EXT_CSD_URGENT_BKOPS | + EXT_CSD_DYNCAP_NEEDED | + EXT_CSD_SYSPOOL_EXHAUSTED + | EXT_CSD_PACKED_FAILURE); + kfree(ext_csd); return 0; } diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 11f824a78d29..1c4a15dc5fbb 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -645,7 +645,7 @@ static ssize_t store_enable(struct device *dev, struct mmc_host *host = cls_dev_to_mmc_host(dev); unsigned long value; - if (!host || kstrtoul(buf, 0, &value)) + if (!host || !host->card || kstrtoul(buf, 0, &value)) return -EINVAL; mmc_get_card(host->card); diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index fa3fd73b4bc5..78dae0679645 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1550,7 +1550,6 @@ static int mmc_select_hs_ddr52(struct mmc_host *host) int err; mmc_select_hs(host->card); - mmc_set_clock(host, MMC_HIGH_52_MAX_DTR); err = mmc_select_bus_width(host->card); if (err < 0) { pr_err("%s: %s: select_bus_width failed(%d)\n", @@ -1559,6 +1558,7 @@ static int mmc_select_hs_ddr52(struct mmc_host *host) } err = mmc_select_hs_ddr(host->card); + mmc_set_clock(host, MMC_HIGH_52_MAX_DTR); return err; } @@ -1610,6 +1610,11 @@ static int mmc_scale_high(struct mmc_host *host) { int err = 0; + if (mmc_card_ddr52(host->card)) { + mmc_set_timing(host, MMC_TIMING_LEGACY); + mmc_set_clock(host, MMC_HIGH_26_MAX_DTR); + } + if (!host->card->ext_csd.strobe_support) { if (!(host->card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200)) { pr_err("%s: %s: card does not support HS200\n", @@ -1706,7 +1711,7 @@ static int mmc_change_bus_speed(struct mmc_host *host, unsigned long *freq) * for other timings we can simply do clock frequency change */ if (mmc_card_hs400(card) || - (*freq == MMC_HS200_MAX_DTR)) { + (!mmc_card_hs200(host->card) && *freq == MMC_HS200_MAX_DTR)) { err = mmc_set_clock_bus_speed(card, *freq); if (err) { pr_err("%s: %s: failed (%d)to set bus and clock speed (freq=%lu)\n", @@ -2434,7 +2439,7 @@ static int mmc_test_awake_ext_csd(struct mmc_host *host) struct mmc_card *card = host->card; err = mmc_get_ext_csd(card, &ext_csd); - if (err) { + if (err || !ext_csd) { pr_err("%s: %s: mmc_get_ext_csd failed (%d)\n", mmc_hostname(host), __func__, err); return err; @@ -2515,9 +2520,16 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) goto out; if (mmc_can_sleepawake(host)) { + /* + * For caching host->ios to cached_ios we need to + * make sure that clocks are not gated otherwise + * cached_ios->clock will be 0. + */ + mmc_host_clk_hold(host); memcpy(&host->cached_ios, &host->ios, sizeof(host->cached_ios)); mmc_cache_card_ext_csd(host); err = mmc_sleepawake(host, true); + mmc_host_clk_release(host); } else if (!mmc_host_is_spi(host)) { err = mmc_deselect_cards(host); } @@ -2550,12 +2562,12 @@ static int mmc_partial_init(struct mmc_host *host) mmc_host_clk_hold(host); - if (mmc_card_hs200(card) || mmc_card_hs400(card)) { + if (mmc_card_hs400(card)) { if (card->ext_csd.strobe_support && host->ops->enhanced_strobe) err = host->ops->enhanced_strobe(host); - else - err = host->ops->execute_tuning(host, - MMC_SEND_TUNING_BLOCK_HS200); + } else if (mmc_card_hs200(card) && host->ops->execute_tuning) { + err = host->ops->execute_tuning(host, + MMC_SEND_TUNING_BLOCK_HS200); if (err) pr_warn("%s: %s: tuning execution failed (%d)\n", mmc_hostname(host), __func__, err); diff --git a/drivers/mmc/host/cmdq_hci.c b/drivers/mmc/host/cmdq_hci.c index 71d20922bd4c..0e0a018f39be 100644 --- a/drivers/mmc/host/cmdq_hci.c +++ b/drivers/mmc/host/cmdq_hci.c @@ -408,6 +408,9 @@ static int cmdq_enable(struct mmc_host *mmc) cq_host->enabled = true; mmc_host_clr_cq_disable(mmc); + if (cq_host->ops->set_transfer_params) + cq_host->ops->set_transfer_params(mmc); + if (cq_host->ops->set_block_size) cq_host->ops->set_block_size(cq_host->mmc); @@ -729,8 +732,6 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq) } cq_host->mrq_slot[tag] = mrq; - if (cq_host->ops->set_tranfer_params) - cq_host->ops->set_tranfer_params(mmc); /* PM QoS */ sdhci_msm_pm_qos_irq_vote(host); @@ -997,6 +998,10 @@ static int cmdq_halt(struct mmc_host *mmc, bool halt) } ret = retries ? 0 : -ETIMEDOUT; } else { + if (cq_host->ops->set_transfer_params) + cq_host->ops->set_transfer_params(mmc); + if (cq_host->ops->set_block_size) + cq_host->ops->set_block_size(mmc); if (cq_host->ops->set_data_timeout) cq_host->ops->set_data_timeout(mmc, 0xf); if (cq_host->ops->clear_set_irqs) diff --git a/drivers/mmc/host/cmdq_hci.h b/drivers/mmc/host/cmdq_hci.h index 91cb25b78481..e1cbb126f411 100644 --- a/drivers/mmc/host/cmdq_hci.h +++ b/drivers/mmc/host/cmdq_hci.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -197,7 +197,7 @@ struct cmdq_host { }; struct cmdq_host_ops { - void (*set_tranfer_params)(struct mmc_host *mmc); + void (*set_transfer_params)(struct mmc_host *mmc); void (*set_data_timeout)(struct mmc_host *mmc, u32 val); void (*clear_set_irqs)(struct mmc_host *mmc, bool clear); void (*set_block_size)(struct mmc_host *mmc); diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index fecb45daa827..68427bf47ca6 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -3936,7 +3936,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) /* Extract platform data */ if (pdev->dev.of_node) { ret = of_alias_get_id(pdev->dev.of_node, "sdhc"); - if (ret < 0) { + if (ret <= 0) { dev_err(&pdev->dev, "Failed to get slot index %d\n", ret); goto pltfm_free; @@ -3955,10 +3955,8 @@ static int sdhci_msm_probe(struct platform_device *pdev) goto pltfm_free; } - if (ret <= 2) { + if (ret <= 2) sdhci_slot[ret-1] = msm_host; - host->slot_no = ret; - } msm_host->pdata = sdhci_msm_populate_pdata(&pdev->dev, msm_host); @@ -4159,6 +4157,8 @@ static int sdhci_msm_probe(struct platform_device *pdev) host->quirks2 |= SDHCI_QUIRK2_IGNORE_DATATOUT_FOR_R1BCMD; host->quirks2 |= SDHCI_QUIRK2_BROKEN_PRESET_VALUE; host->quirks2 |= SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT; + host->quirks2 |= SDHCI_QUIRK2_NON_STANDARD_TUNING; + host->quirks2 |= SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING; if (host->quirks2 & SDHCI_QUIRK2_ALWAYS_USE_BASE_CLOCK) host->quirks2 |= SDHCI_QUIRK2_DIVIDE_TOUT_BY_4; @@ -4214,7 +4214,6 @@ static int sdhci_msm_probe(struct platform_device *pdev) msm_host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; msm_host->mmc->caps2 |= msm_host->pdata->caps2; msm_host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC; - msm_host->mmc->caps2 |= MMC_CAP2_FULL_PWR_CYCLE; msm_host->mmc->caps2 |= MMC_CAP2_HS400_POST_TUNING; msm_host->mmc->caps2 |= MMC_CAP2_CLK_SCALE; msm_host->mmc->caps2 |= MMC_CAP2_SANITIZE; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9beb37b4e241..b32b87f44f92 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -172,8 +172,6 @@ static void sdhci_dumpregs(struct sdhci_host *host) host->ops->dump_vendor_regs(host); sdhci_dump_state(host); pr_info(DRIVER_NAME ": ===========================================\n"); - if (host->slot_no == 1) - BUG_ON(1); } /*****************************************************************************\ @@ -860,6 +858,10 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) host->flags |= SDHCI_REQ_USE_DMA; + if ((host->quirks2 & SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING) && + cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200) + host->flags &= ~SDHCI_REQ_USE_DMA; + /* * FIXME: This doesn't account for merging when mapping the * scatterlist. @@ -2900,8 +2902,9 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) /* CMD19 generates _only_ Buffer Read Ready interrupt */ if (intmask & SDHCI_INT_DATA_AVAIL) { - if (command == MMC_SEND_TUNING_BLOCK || - command == MMC_SEND_TUNING_BLOCK_HS200) { + if (!(host->quirks2 & SDHCI_QUIRK2_NON_STANDARD_TUNING) && + (command == MMC_SEND_TUNING_BLOCK || + command == MMC_SEND_TUNING_BLOCK_HS200)) { host->tuning_done = 1; wake_up(&host->buf_ready_int); return; @@ -3091,8 +3094,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) if (!host->clock && host->mmc->card && mmc_card_sdio(host->mmc->card)) { - if (!mmc_card_and_host_support_async_int(host->mmc)) + if (!mmc_card_and_host_support_async_int(host->mmc)) { + spin_unlock(&host->lock); return IRQ_NONE; + } /* * async card interrupt is level sensitive and received * when clocks are off. @@ -3471,6 +3476,24 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, EXPORT_SYMBOL_GPL(sdhci_alloc_host); #ifdef CONFIG_MMC_CQ_HCI +static void sdhci_cmdq_set_transfer_params(struct mmc_host *mmc) +{ + struct sdhci_host *host = mmc_priv(mmc); + u8 ctrl; + + if (host->version >= SDHCI_SPEC_200) { + ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); + ctrl &= ~SDHCI_CTRL_DMA_MASK; + if (host->flags & SDHCI_USE_ADMA_64BIT) + ctrl |= SDHCI_CTRL_ADMA64; + else + ctrl |= SDHCI_CTRL_ADMA32; + sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); + } + if (host->ops->toggle_cdr) + host->ops->toggle_cdr(host, false); +} + static void sdhci_cmdq_clear_set_irqs(struct mmc_host *mmc, bool clear) { struct sdhci_host *host = mmc_priv(mmc); @@ -3567,6 +3590,10 @@ static void sdhci_cmdq_post_cqe_halt(struct mmc_host *mmc) sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS); } #else +static void sdhci_cmdq_set_transfer_params(struct mmc_host *mmc) +{ + +} static void sdhci_cmdq_clear_set_irqs(struct mmc_host *mmc, bool clear) { @@ -3627,6 +3654,7 @@ static const struct cmdq_host_ops sdhci_cmdq_ops = { .crypto_cfg = sdhci_cmdq_crypto_cfg, .crypto_cfg_reset = sdhci_cmdq_crypto_cfg_reset, .post_cqe_halt = sdhci_cmdq_post_cqe_halt, + .set_transfer_params = sdhci_cmdq_set_transfer_params, }; #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 9b39821b57ef..da963972b9a4 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -501,6 +501,18 @@ struct sdhci_host { #define SDHCI_QUIRK2_USE_RESET_WORKAROUND (1<<26) /* Some controllers doesn't have have any LED control */ #define SDHCI_QUIRK2_BROKEN_LED_CONTROL (1<<27) +/* + * Some controllers doesn't follow the tuning procedure as defined in spec. + * The tuning data has to be compared from SW driver to validate the correct + * phase. + */ +#define SDHCI_QUIRK2_NON_STANDARD_TUNING (1 << 28) +/* + * Some controllers may use PIO mode to workaround HW issues in ADMA for + * eMMC tuning commands. + */ +#define SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING (1 << 23) + int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ @@ -611,8 +623,6 @@ struct sdhci_host { ktime_t reset_wa_t; /* time when the reset workaround is applied */ int reset_wa_cnt; /* total number of times workaround is used */ - int slot_no; - unsigned long private[0] ____cacheline_aligned; }; diff --git a/drivers/soundwire/swr-wcd-ctrl.c b/drivers/soundwire/swr-wcd-ctrl.c index a8f93beeabbe..2cb60c11e212 100644 --- a/drivers/soundwire/swr-wcd-ctrl.c +++ b/drivers/soundwire/swr-wcd-ctrl.c @@ -675,6 +675,11 @@ static void swrm_cleanup_disabled_data_ports(struct swr_master *master, int port_disable_cnt = 0; struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master); + if (!swrm) { + pr_err("%s: swrm is null\n", __func__); + return; + } + dev_dbg(swrm->dev, "%s: master num_port: %d\n", __func__, master->num_port); @@ -740,6 +745,11 @@ static void swrm_slvdev_datapath_control(struct swr_master *master, SWRM_MCP_FRAME_CTRL_BANK_SSP_PERIOD_BMSK); u8 inactive_bank; + if (!swrm) { + pr_err("%s: swrm is null\n", __func__); + return; + } + bank = get_inactive_bank_num(swrm); dev_dbg(swrm->dev, "%s: enable: %d, cfg_devs: %d\n", @@ -829,6 +839,11 @@ static void swrm_copy_data_port_config(struct swr_master *master, u8 bank) int len = 0; struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master); + if (!swrm) { + pr_err("%s: swrm is null\n", __func__); + return; + } + dev_dbg(swrm->dev, "%s: master num_port: %d\n", __func__, master->num_port); @@ -975,13 +990,12 @@ port_fail: mem_fail: list_for_each_safe(ptr, next, &swrm->mport_list) { mport = list_entry(ptr, struct swrm_mports, list); - if (!mport) - continue; for (i = 0; i < portinfo->num_port; i++) { if (portinfo->port_id[i] == mstr_ports[mport->id]) { port = swrm_get_port(master, portinfo->port_id[i]); - port->ch_en = false; + if (port) + port->ch_en = false; list_del(&mport->list); kfree(mport); break; diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 1c102d60cd9f..9b2b98cf1823 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -2574,7 +2574,7 @@ static void hcd_release(struct kref *kref) struct usb_hcd *hcd = container_of (kref, struct usb_hcd, kref); mutex_lock(&usb_port_peer_mutex); - if (usb_hcd_is_primary_hcd(hcd)) + if (hcd->primary_hcd == hcd) kfree(hcd->bandwidth_mutex); if (hcd->shared_hcd) { struct usb_hcd *peer = hcd->shared_hcd; diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c index d6db871e5b1b..5888ad9e36be 100644 --- a/drivers/video/fbdev/msm/mdss_fb.c +++ b/drivers/video/fbdev/msm/mdss_fb.c @@ -4470,7 +4470,8 @@ static int mdss_fb_atomic_commit_ioctl(struct fb_info *info, } ds_data_user = commit.commit_v1.dest_scaler; - if (ds_data_user) { + if ((ds_data_user) && + (commit.commit_v1.dest_scaler_cnt)) { ret = __mdss_fb_copy_destscaler_data(info, &commit); if (ret) { pr_err("copy dest scaler failed\n"); diff --git a/drivers/video/fbdev/msm/mdss_mdp_layer.c b/drivers/video/fbdev/msm/mdss_mdp_layer.c index 29d6caa8ff7b..59283c815897 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_layer.c +++ b/drivers/video/fbdev/msm/mdss_mdp_layer.c @@ -126,7 +126,7 @@ static int mdss_mdp_destination_scaler_pre_validate(struct mdss_mdp_ctl *ctl, * width and height accordingly. Otherwise, layer validate will fail * when we switch between scaling factor or disabling scaling. */ - if (test_bit(MDSS_CAPS_DEST_SCALER, mdata->mdss_caps_map) && ds_data) { + if (test_bit(MDSS_CAPS_DEST_SCALER, mdata->mdss_caps_map)) { if (ctl->mixer_left) { /* * Any scale update from usermode, we will update the @@ -2073,7 +2073,8 @@ static int __validate_layers(struct msm_fb_data_type *mfd, } if (test_bit(MDSS_CAPS_DEST_SCALER, mdata->mdss_caps_map) && - commit->dest_scaler) { + commit->dest_scaler && + commit->dest_scaler_cnt) { /* * Find out which DS block to use based on LM assignment */ @@ -2370,10 +2371,13 @@ int mdss_mdp_layer_atomic_validate(struct msm_fb_data_type *mfd, } } - if (mdss_mdp_destination_scaler_pre_validate(mdp5_data->ctl, - commit->dest_scaler)) { - pr_err("Destination scaler pre-validate failed\n"); - return -EINVAL; + if (commit->dest_scaler && commit->dest_scaler_cnt) { + rc = mdss_mdp_destination_scaler_pre_validate(mdp5_data->ctl, + commit->dest_scaler); + if (IS_ERR_VALUE(rc)) { + pr_err("Destination scaler pre-validate failed\n"); + return -EINVAL; + } } return __validate_layers(mfd, file, commit); diff --git a/include/linux/mfd/msm-cdc-pinctrl.h b/include/linux/mfd/msm-cdc-pinctrl.h index a4a34c125581..395b935b6aec 100644 --- a/include/linux/mfd/msm-cdc-pinctrl.h +++ b/include/linux/mfd/msm-cdc-pinctrl.h @@ -19,6 +19,7 @@ #ifdef CONFIG_MSM_CDC_PINCTRL extern int msm_cdc_pinctrl_select_sleep_state(struct device_node *); extern int msm_cdc_pinctrl_select_active_state(struct device_node *); +extern bool msm_cdc_pinctrl_get_state(struct device_node *); #else int msm_cdc_pinctrl_select_sleep_state(struct device_node *np) diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index e7578be38ddf..1c87478b5fc0 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -128,6 +128,7 @@ struct mmc_ext_csd { u8 raw_pwr_cl_ddr_52_360; /* 239 */ u8 raw_pwr_cl_ddr_200_360; /* 253 */ u8 cache_flush_policy; /* 240 */ +#define MMC_BKOPS_URGENCY_MASK 0x3 u8 raw_bkops_status; /* 246 */ u8 raw_sectors[4]; /* 212 - 4 bytes */ u8 cmdq_depth; /* 307 */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index eeafd4782e11..c7d6f92f041b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2512,6 +2512,14 @@ static bool __zone_watermark_ok(struct zone *z, unsigned int order, return true; for (mt = 0; mt < MIGRATE_PCPTYPES; mt++) { +#ifdef CONFIG_CMA + /* + * Note that this check is needed only + * when MIGRATE_CMA < MIGRATE_PCPTYPES. + */ + if (mt == MIGRATE_CMA) + continue; +#endif if (!list_empty(&area->free_list[mt])) return true; } diff --git a/sound/soc/codecs/wcd9330.c b/sound/soc/codecs/wcd9330.c index 4d8f7b210dab..e99337cb63d4 100644 --- a/sound/soc/codecs/wcd9330.c +++ b/sound/soc/codecs/wcd9330.c @@ -2938,7 +2938,7 @@ int tomtom_codec_mclk_enable(struct snd_soc_codec *codec, __func__, enable, dapm); return __tomtom_mclk_enable(tomtom, enable); } else if (tomtom->codec_ext_clk_en_cb) - return tomtom_codec_ext_clk_en(codec, true, false); + return tomtom_codec_ext_clk_en(codec, enable, dapm); else { dev_err(codec->dev, "%s: Cannot turn on MCLK\n", diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 18dc404ac31d..8c7ab5a8f358 100755 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -5397,6 +5397,13 @@ static int tasha_codec_enable_dec(struct snd_soc_dapm_widget *w, break; case SND_SOC_DAPM_POST_PMU: snd_soc_update_bits(codec, hpf_gate_reg, 0x01, 0x00); + + if (decimator == 0) { + snd_soc_write(codec, WCD9335_MBHC_ZDET_RAMP_CTL, 0x83); + snd_soc_write(codec, WCD9335_MBHC_ZDET_RAMP_CTL, 0xA3); + snd_soc_write(codec, WCD9335_MBHC_ZDET_RAMP_CTL, 0x83); + snd_soc_write(codec, WCD9335_MBHC_ZDET_RAMP_CTL, 0x03); + } /* schedule work queue to Remove Mute */ schedule_delayed_work(&tasha->tx_mute_dwork[decimator].dwork, msecs_to_jiffies(tx_unmute_delay)); diff --git a/sound/soc/msm/msm-dai-fe.c b/sound/soc/msm/msm-dai-fe.c index f4a1b41cb5d0..ee233f7ad8ae 100644 --- a/sound/soc/msm/msm-dai-fe.c +++ b/sound/soc/msm/msm-dai-fe.c @@ -1924,13 +1924,13 @@ static struct snd_soc_dai_driver msm_fe_dais[] = { .capture = { .stream_name = "CPE Listen Audio capture", .aif_name = "CPE_LSM_UL_HL", - .rates = SNDRV_PCM_RATE_16000, + .rates = SNDRV_PCM_RATE_8000_48000, .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE), .channels_min = 1, .channels_max = 1, - .rate_min = 16000, - .rate_max = 16000, + .rate_min = 8000, + .rate_max = 48000, }, .ops = &msm_fe_dai_ops, .name = "CPE_LSM_NOHOST", diff --git a/sound/soc/msm/msmcobalt.c b/sound/soc/msm/msmcobalt.c index 07bade08b3f5..88225e8a4861 100644 --- a/sound/soc/msm/msmcobalt.c +++ b/sound/soc/msm/msmcobalt.c @@ -22,6 +22,7 @@ #include <linux/module.h> #include <linux/switch.h> #include <linux/input.h> +#include <linux/mfd/msm-cdc-pinctrl.h> #include <sound/core.h> #include <sound/soc.h> #include <sound/soc-dapm.h> @@ -107,9 +108,10 @@ struct msm_wsa881x_dev_info { struct msm_asoc_mach_data { u32 mclk_freq; - int us_euro_gpio; int hph_en1_gpio; int hph_en0_gpio; + int us_euro_gpio; /* used by gpio driver API */ + struct device_node *us_euro_gpio_p; /* used by pinctrl API */ struct snd_info_entry *codec_root; }; @@ -1155,10 +1157,21 @@ static bool msm_swap_gnd_mic(struct snd_soc_codec *codec) struct snd_soc_card *card = codec->component.card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); - int value = gpio_get_value_cansleep(pdata->us_euro_gpio); + int value; + if (pdata->us_euro_gpio_p) { + value = msm_cdc_pinctrl_get_state(pdata->us_euro_gpio_p); + if (value) + msm_cdc_pinctrl_select_sleep_state( + pdata->us_euro_gpio_p); + else + msm_cdc_pinctrl_select_active_state( + pdata->us_euro_gpio_p); + } else if (pdata->us_euro_gpio >= 0) { + value = gpio_get_value_cansleep(pdata->us_euro_gpio); + gpio_set_value_cansleep(pdata->us_euro_gpio, !value); + } pr_debug("%s: swap select switch %d to %d\n", __func__, value, !value); - gpio_set_value_cansleep(pdata->us_euro_gpio, !value); return true; } @@ -3517,13 +3530,15 @@ static int msm_asoc_machine_probe(struct platform_device *pdev) */ pdata->us_euro_gpio = of_get_named_gpio(pdev->dev.of_node, "qcom,us-euro-gpios", 0); - if (pdata->us_euro_gpio < 0) { + if (pdata->us_euro_gpio < 0) + pdata->us_euro_gpio_p = of_parse_phandle(pdev->dev.of_node, + "qcom,us-euro-gpios", 0); + if ((pdata->us_euro_gpio < 0) && (!pdata->us_euro_gpio_p)) { dev_info(&pdev->dev, "property %s not detected in node %s", - "qcom,us-euro-gpios", - pdev->dev.of_node->full_name); + "qcom,us-euro-gpios", pdev->dev.of_node->full_name); } else { - dev_dbg(&pdev->dev, "%s detected %d", - "qcom,us-euro-gpios", pdata->us_euro_gpio); + dev_dbg(&pdev->dev, "%s detected", + "qcom,us-euro-gpios"); wcd_mbhc_cfg.swap_gnd_mic = msm_swap_gnd_mic; } |
