From df192db7689c10ee3d64d60ba6be611d67df09e7 Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Mon, 18 Aug 2014 06:06:46 +0100 Subject: mmc: mmci: Support any block sizes for ux500v2 and qcom variant For the ux500v2 variant of the PL18x block, any block sizes are supported. This will make it possible to decrease data overhead for SDIO transfers. This patch is based on Ulf Hansson patch http://www.spinics.net/lists/linux-mmc/msg12160.html Signed-off-by: Srinivas Kandagatla enabled this support on qcom variant. Signed-off-by: Ulf Hansson Signed-off-by: Linus Walleij --- drivers/mmc/host/mmci.c | 6 +++++- drivers/mmc/host/mmci.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 356833a606d5..4b5ef3c96e7d 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -221,6 +221,7 @@ static struct variant_data variant_ux500v2 = { .start_err = MCI_STARTBITERR, .opendrain = MCI_OD, .init = ux500v2_variant_init, + .any_blksize = true, }; static struct variant_data variant_stm32 = { @@ -292,6 +293,7 @@ static struct variant_data variant_qcom = { .start_err = MCI_STARTBITERR, .opendrain = MCI_ROD, .init = qcom_variant_init, + .any_blksize = true, }; /* Busy detection for the ST Micro variant */ @@ -450,10 +452,12 @@ void mmci_dma_setup(struct mmci_host *host) static int mmci_validate_data(struct mmci_host *host, struct mmc_data *data) { + struct variant_data *variant = host->variant; + if (!data) return 0; - if (!is_power_of_2(data->blksz)) { + if (!is_power_of_2(data->blksz) && !variant->any_blksize) { dev_err(mmc_dev(host->mmc), "unsupported block size (%d bytes)\n", data->blksz); return -EINVAL; diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 4f071bd34e59..a7dc2c0e095a 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -308,6 +308,7 @@ struct mmci_host; * @opendrain: bitmask identifying the OPENDRAIN bit inside MMCIPOWER register * @dma_lli: true if variant has dma link list feature. * @stm32_idmabsize_mask: stm32 sdmmc idma buffer size. + * @any_blksize: true if block any sizes are supported */ struct variant_data { unsigned int clkreg; @@ -350,6 +351,7 @@ struct variant_data { u32 opendrain; u8 dma_lli:1; u32 stm32_idmabsize_mask; + bool any_blksize; void (*init)(struct mmci_host *host); }; -- cgit v1.2.3 From 0688017ad40081f62989bd25fa64ad35b19abbec Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 6 Dec 2016 14:52:19 +0530 Subject: [HACK] clk: qcom: Hook up gpu_gx gdsc as a parent of gpu_gdsc the GPU device on msm8996 requires 2 gdscs to be powered on. With powerdomains we have a limitation wherein only one powerdomain can be associated with a given device in DT. So hook the 2 gdscs together so both are powered on/off when the gpu driver needs them to. [Amit] We use this hack until genpd allows multiple powerdomains to be associated with a device. Signed-off-by: Rajendra Nayak Signed-off-by: Amit Kucheria --- drivers/clk/qcom/mmcc-msm8996.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/clk/qcom/mmcc-msm8996.c b/drivers/clk/qcom/mmcc-msm8996.c index 7235510eac94..92e2fb88ee60 100644 --- a/drivers/clk/qcom/mmcc-msm8996.c +++ b/drivers/clk/qcom/mmcc-msm8996.c @@ -3053,16 +3053,6 @@ static struct gdsc mdss_gdsc = { .pwrsts = PWRSTS_OFF_ON, }; -static struct gdsc gpu_gdsc = { - .gdscr = 0x4034, - .gds_hw_ctrl = 0x4038, - .pd = { - .name = "gpu", - }, - .pwrsts = PWRSTS_OFF_ON, - .flags = VOTABLE, -}; - static struct gdsc gpu_gx_gdsc = { .gdscr = 0x4024, .clamp_io_ctrl = 0x4300, @@ -3075,6 +3065,17 @@ static struct gdsc gpu_gx_gdsc = { .flags = CLAMP_IO, }; +static struct gdsc gpu_gdsc = { + .gdscr = 0x4034, + .gds_hw_ctrl = 0x4038, + .pd = { + .name = "gpu", + }, + .parent = &gpu_gx_gdsc.pd, + .pwrsts = PWRSTS_OFF_ON, + .flags = VOTABLE, +}; + static struct clk_regmap *mmcc_msm8996_clocks[] = { [MMPLL0_EARLY] = &mmpll0_early.clkr, [MMPLL0_PLL] = &mmpll0.clkr, -- cgit v1.2.3 From f6064307fe20fb8edf9a635041049c9c87076d70 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Fri, 18 Nov 2016 15:20:39 +0530 Subject: drm/msm/hdmi: wait a bit for HPD sense to come up It can take a while for the HPD sense to come up once we've configured it. If we call HDMI connector's detect() very soon after configuring HPD registers, drm might think we don't have HDMI connected. Wait a bit before we let drm use the connector funcs. Signed-off-by: Archit Taneja --- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index a6eeab2c4dc3..40a9d4785c3f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -224,6 +224,13 @@ int msm_hdmi_hpd_enable(struct drm_connector *connector) HDMI_HPD_CTRL_ENABLE | hpd_ctrl); spin_unlock_irqrestore(&hdmi->reg_lock, flags); + /* + * wait for a bit so that HPD is sensed if there is a cable already + * connected. Returning early will result in someone calling the + * connnector func's detect() callback too early + */ + msleep(15); + return 0; fail: -- cgit v1.2.3 From 1503e26b6d9e25d915ea9ae2bd56dd296ef1a298 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Thu, 28 Sep 2017 05:01:43 +0530 Subject: drm/msm/hdmi: Keep the HDMI_CTRL_ENABLE bitfield always on The ENABLE field in REG_HDMI_CTRL is required to be set to detect hot plug events on 8x96. We don't get any HPD interrupts when HDMI bridge is disabled. Keep it always on. Downstream also seems to do the same thing. Restrict this quirk only to 8x96, since we're not entirely sure whether this is a legitimate fix or not. Signed-off-by: Archit Taneja --- drivers/gpu/drm/msm/hdmi/hdmi.c | 3 +++ drivers/gpu/drm/msm/hdmi/hdmi.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index e247d6942a49..af9072ace23c 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -39,6 +39,8 @@ void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on) } } else { ctrl = HDMI_CTRL_HDMI; + if (hdmi->config->keep_ctrl_on) + ctrl |= HDMI_CTRL_ENABLE; } hdmi_write(hdmi, REG_HDMI_CTRL, ctrl); @@ -420,6 +422,7 @@ static struct hdmi_platform_config hdmi_tx_8996_config = { HDMI_CFG(pwr_clk, 8x74), HDMI_CFG(hpd_clk, 8x74), .hpd_freq = hpd_clk_freq_8x74, + .keep_ctrl_on = true, }; static const struct { diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h index 5c5df6ab2a57..342103d7d91e 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -121,6 +121,9 @@ struct hdmi_platform_config { /* gpio's: */ struct hdmi_gpio_data gpios[HDMI_MAX_NUM_GPIO]; + + /* caps, etc. */ + bool keep_ctrl_on; }; void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on); -- cgit v1.2.3 From c9ab94e4561b7c631d2ed08deacf53af2d7dd712 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Thu, 28 Sep 2017 05:30:02 +0530 Subject: drm/msm/hdmi: Switch to DRM_CONNECTOR_POLL_HPD We support HPD interrupts on all platofrms, let's start using it. Signed-off-by: Archit Taneja --- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index 40a9d4785c3f..151c8549173f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -472,8 +472,7 @@ struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi) DRM_MODE_CONNECTOR_HDMIA); drm_connector_helper_add(connector, &msm_hdmi_connector_helper_funcs); - connector->polled = DRM_CONNECTOR_POLL_CONNECT | - DRM_CONNECTOR_POLL_DISCONNECT; + connector->polled = DRM_CONNECTOR_POLL_HPD; connector->interlace_allowed = 0; connector->doublescan_allowed = 0; -- cgit v1.2.3