linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-pci-gli: Enable short circuit protection mechanism of GL9755
@ 2021-02-25 11:13 Renius Chen
  2021-03-02 10:39 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Renius Chen @ 2021-02-25 11:13 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter
  Cc: linux-mmc, linux-kernel, ben.chuang, greg.tu, Renius Chen

Short circuit protection mechanism of GL9755 is disabled by HW default
setting. Enable short circuit protection to prevent GL9755 from being
damaged by short circuit or over current.

Signed-off-by: Renius Chen <reniuschengl@gmail.com>
---
 drivers/mmc/host/sdhci-pci-gli.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c
index 5606bdc08a96..7ba0fd601696 100644
--- a/drivers/mmc/host/sdhci-pci-gli.c
+++ b/drivers/mmc/host/sdhci-pci-gli.c
@@ -123,6 +123,9 @@
 #define PCI_GLI_9755_PLLSSC        0x68
 #define   PCI_GLI_9755_PLLSSC_PPM    GENMASK(15, 0)
 
+#define PCI_GLI_9755_SerDes  0x70
+#define PCI_GLI_9755_SCP_DIS   BIT(19)
+
 #define GLI_MAX_TUNING_LOOP 40
 
 /* Genesys Logic chipset */
@@ -547,6 +550,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
 	value &= ~PCI_GLI_9755_DMACLK;
 	pci_write_config_dword(pdev, PCI_GLI_9755_PECONF, value);
 
+	/* enable short circuit protection */
+	pci_read_config_dword(pdev, PCI_GLI_9755_SerDes, &value);
+	value &= ~PCI_GLI_9755_SCP_DIS;
+	pci_write_config_dword(pdev, PCI_GLI_9755_SerDes, value);
+
 	gl9755_wt_off(pdev);
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: sdhci-pci-gli: Enable short circuit protection mechanism of GL9755
  2021-02-25 11:13 [PATCH] mmc: sdhci-pci-gli: Enable short circuit protection mechanism of GL9755 Renius Chen
@ 2021-03-02 10:39 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2021-03-02 10:39 UTC (permalink / raw)
  To: Renius Chen
  Cc: Adrian Hunter, linux-mmc, Linux Kernel Mailing List, Ben Chuang, greg.tu

On Thu, 25 Feb 2021 at 12:13, Renius Chen <reniuschengl@gmail.com> wrote:
>
> Short circuit protection mechanism of GL9755 is disabled by HW default
> setting. Enable short circuit protection to prevent GL9755 from being
> damaged by short circuit or over current.
>
> Signed-off-by: Renius Chen <reniuschengl@gmail.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-pci-gli.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c
> index 5606bdc08a96..7ba0fd601696 100644
> --- a/drivers/mmc/host/sdhci-pci-gli.c
> +++ b/drivers/mmc/host/sdhci-pci-gli.c
> @@ -123,6 +123,9 @@
>  #define PCI_GLI_9755_PLLSSC        0x68
>  #define   PCI_GLI_9755_PLLSSC_PPM    GENMASK(15, 0)
>
> +#define PCI_GLI_9755_SerDes  0x70
> +#define PCI_GLI_9755_SCP_DIS   BIT(19)
> +
>  #define GLI_MAX_TUNING_LOOP 40
>
>  /* Genesys Logic chipset */
> @@ -547,6 +550,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
>         value &= ~PCI_GLI_9755_DMACLK;
>         pci_write_config_dword(pdev, PCI_GLI_9755_PECONF, value);
>
> +       /* enable short circuit protection */
> +       pci_read_config_dword(pdev, PCI_GLI_9755_SerDes, &value);
> +       value &= ~PCI_GLI_9755_SCP_DIS;
> +       pci_write_config_dword(pdev, PCI_GLI_9755_SerDes, value);
> +
>         gl9755_wt_off(pdev);
>  }
>
> --
> 2.27.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-02 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 11:13 [PATCH] mmc: sdhci-pci-gli: Enable short circuit protection mechanism of GL9755 Renius Chen
2021-03-02 10:39 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).