All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status
@ 2021-04-24 17:41 ` Ferry Toth
  2021-04-25 10:40   ` Andy Shevchenko
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ferry Toth @ 2021-04-24 17:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: MyungJoo Ham, Chanwoo Choi, Ferry Toth, Andy Shevchenko

extcon driver for Basin Cove PMIC shadows the switch status used for dwc3
DRD to detect a change in the switch position. This change initializes the
status at probe time.

Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Fixes: 492929c54791 ("extcon: mrfld: Introduce extcon driver for Basin Cove PMIC")
---
 drivers/extcon/extcon-intel-mrfld.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c
index f47016fb28a8..cd1a5f230077 100644
--- a/drivers/extcon/extcon-intel-mrfld.c
+++ b/drivers/extcon/extcon-intel-mrfld.c
@@ -197,6 +197,7 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
 	struct intel_soc_pmic *pmic = dev_get_drvdata(dev->parent);
 	struct regmap *regmap = pmic->regmap;
 	struct mrfld_extcon_data *data;
+	unsigned int status;
 	unsigned int id;
 	int irq, ret;
 
@@ -244,6 +245,14 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
 	/* Get initial state */
 	mrfld_extcon_role_detect(data);
 
+	/*
+	 * Cached status value is used for cable detection, see comments
+	 * in mrfld_extcon_cable_detect(), we need to sync cached value
+	 * with a real state of the hardware.
+	 */
+	regmap_read(regmap, BCOVE_SCHGRIRQ1, &status);
+	data->status = status;
+
 	mrfld_extcon_clear(data, BCOVE_MIRQLVL1, BCOVE_LVL1_CHGR);
 	mrfld_extcon_clear(data, BCOVE_MCHGRIRQ1, BCOVE_CHGRIRQ_ALL);
 
-- 
2.27.0


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

* Re: [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status
  2021-04-24 17:41 ` [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status Ferry Toth
@ 2021-04-25 10:40   ` Andy Shevchenko
  2021-05-17 13:53   ` Andy Shevchenko
  2021-05-18  2:52   ` Chanwoo Choi
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-04-25 10:40 UTC (permalink / raw)
  To: Ferry Toth
  Cc: Linux Kernel Mailing List, MyungJoo Ham, Chanwoo Choi, Andy Shevchenko

On Sat, Apr 24, 2021 at 8:58 PM Ferry Toth <ftoth@exalondelft.nl> wrote:
>
> extcon driver for Basin Cove PMIC shadows the switch status used for dwc3
> DRD to detect a change in the switch position. This change initializes the
> status at probe time.

Thanks for catching and fixing this issue!

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
> Fixes: 492929c54791 ("extcon: mrfld: Introduce extcon driver for Basin Cove PMIC")
> ---
>  drivers/extcon/extcon-intel-mrfld.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c
> index f47016fb28a8..cd1a5f230077 100644
> --- a/drivers/extcon/extcon-intel-mrfld.c
> +++ b/drivers/extcon/extcon-intel-mrfld.c
> @@ -197,6 +197,7 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>         struct intel_soc_pmic *pmic = dev_get_drvdata(dev->parent);
>         struct regmap *regmap = pmic->regmap;
>         struct mrfld_extcon_data *data;
> +       unsigned int status;
>         unsigned int id;
>         int irq, ret;
>
> @@ -244,6 +245,14 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>         /* Get initial state */
>         mrfld_extcon_role_detect(data);
>
> +       /*
> +        * Cached status value is used for cable detection, see comments
> +        * in mrfld_extcon_cable_detect(), we need to sync cached value
> +        * with a real state of the hardware.
> +        */
> +       regmap_read(regmap, BCOVE_SCHGRIRQ1, &status);
> +       data->status = status;
> +
>         mrfld_extcon_clear(data, BCOVE_MIRQLVL1, BCOVE_LVL1_CHGR);
>         mrfld_extcon_clear(data, BCOVE_MCHGRIRQ1, BCOVE_CHGRIRQ_ALL);
>
> --
> 2.27.0
>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status
  2021-04-24 17:41 ` [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status Ferry Toth
  2021-04-25 10:40   ` Andy Shevchenko
@ 2021-05-17 13:53   ` Andy Shevchenko
  2021-05-18  2:52   ` Chanwoo Choi
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-05-17 13:53 UTC (permalink / raw)
  To: Ferry Toth; +Cc: linux-kernel, MyungJoo Ham, Chanwoo Choi

On Sat, Apr 24, 2021 at 07:41:38PM +0200, Ferry Toth wrote:
> extcon driver for Basin Cove PMIC shadows the switch status used for dwc3
> DRD to detect a change in the switch position. This change initializes the
> status at probe time.

Chanwoo, can we get this fix in?

> Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
> Fixes: 492929c54791 ("extcon: mrfld: Introduce extcon driver for Basin Cove PMIC")
> ---
>  drivers/extcon/extcon-intel-mrfld.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c
> index f47016fb28a8..cd1a5f230077 100644
> --- a/drivers/extcon/extcon-intel-mrfld.c
> +++ b/drivers/extcon/extcon-intel-mrfld.c
> @@ -197,6 +197,7 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>  	struct intel_soc_pmic *pmic = dev_get_drvdata(dev->parent);
>  	struct regmap *regmap = pmic->regmap;
>  	struct mrfld_extcon_data *data;
> +	unsigned int status;
>  	unsigned int id;
>  	int irq, ret;
>  
> @@ -244,6 +245,14 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>  	/* Get initial state */
>  	mrfld_extcon_role_detect(data);
>  
> +	/*
> +	 * Cached status value is used for cable detection, see comments
> +	 * in mrfld_extcon_cable_detect(), we need to sync cached value
> +	 * with a real state of the hardware.
> +	 */
> +	regmap_read(regmap, BCOVE_SCHGRIRQ1, &status);
> +	data->status = status;
> +
>  	mrfld_extcon_clear(data, BCOVE_MIRQLVL1, BCOVE_LVL1_CHGR);
>  	mrfld_extcon_clear(data, BCOVE_MCHGRIRQ1, BCOVE_CHGRIRQ_ALL);
>  
> -- 
> 2.27.0
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status
  2021-04-24 17:41 ` [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status Ferry Toth
  2021-04-25 10:40   ` Andy Shevchenko
  2021-05-17 13:53   ` Andy Shevchenko
@ 2021-05-18  2:52   ` Chanwoo Choi
  2 siblings, 0 replies; 4+ messages in thread
From: Chanwoo Choi @ 2021-05-18  2:52 UTC (permalink / raw)
  To: Ferry Toth, linux-kernel; +Cc: MyungJoo Ham, Andy Shevchenko

On 4/25/21 2:41 AM, Ferry Toth wrote:
> extcon driver for Basin Cove PMIC shadows the switch status used for dwc3
> DRD to detect a change in the switch position. This change initializes the
> status at probe time.
> 
> Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
> Fixes: 492929c54791 ("extcon: mrfld: Introduce extcon driver for Basin Cove PMIC")
> ---
>  drivers/extcon/extcon-intel-mrfld.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c
> index f47016fb28a8..cd1a5f230077 100644
> --- a/drivers/extcon/extcon-intel-mrfld.c
> +++ b/drivers/extcon/extcon-intel-mrfld.c
> @@ -197,6 +197,7 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>  	struct intel_soc_pmic *pmic = dev_get_drvdata(dev->parent);
>  	struct regmap *regmap = pmic->regmap;
>  	struct mrfld_extcon_data *data;
> +	unsigned int status;
>  	unsigned int id;
>  	int irq, ret;
>  
> @@ -244,6 +245,14 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>  	/* Get initial state */
>  	mrfld_extcon_role_detect(data);
>  
> +	/*
> +	 * Cached status value is used for cable detection, see comments
> +	 * in mrfld_extcon_cable_detect(), we need to sync cached value
> +	 * with a real state of the hardware.
> +	 */
> +	regmap_read(regmap, BCOVE_SCHGRIRQ1, &status);
> +	data->status = status;
> +
>  	mrfld_extcon_clear(data, BCOVE_MIRQLVL1, BCOVE_LVL1_CHGR);
>  	mrfld_extcon_clear(data, BCOVE_MCHGRIRQ1, BCOVE_CHGRIRQ_ALL);
>  
> 

Looks good. But need to change the patch title as following:
I can change the patch title before merge. But, this fixes patch
should be applied to both extcon tree and stable tree.
So that the author better to change the patch title to keep
the consistent patch title naming as following:

If possible, need to specify what to fix on title for the readability.
IMO, this patch title doesn't seems the fix patch.

- before : extcon-intel-mrfld: initialize mrfld_extcon status
- after : extcon: intel-mrfld: Initialize mrfld_extcon status

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

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

end of thread, other threads:[~2021-05-18  2:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210424174208epcas1p2aa4ad71d4450b9995a79e2d378c78865@epcas1p2.samsung.com>
2021-04-24 17:41 ` [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status Ferry Toth
2021-04-25 10:40   ` Andy Shevchenko
2021-05-17 13:53   ` Andy Shevchenko
2021-05-18  2:52   ` Chanwoo Choi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.