All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] reset: meson-audio-arb: add sm1 support
@ 2019-08-20  9:46 ` Jerome Brunet
  0 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20  9:46 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Jerome Brunet, Kevin Hilman, linux-amlogic, devicetree, linux-kernel

This patchset adds the new arb reset lines for the sm1 SoC family

Jerome Brunet (2):
  reset: dt-bindings: meson: update arb bindings for sm1
  reset: meson-audio-arb: add sm1 support

 .../reset/amlogic,meson-axg-audio-arb.txt     |  3 +-
 drivers/reset/reset-meson-audio-arb.c         | 28 +++++++++++++++++--
 .../reset/amlogic,meson-axg-audio-arb.h       |  2 ++
 3 files changed, 29 insertions(+), 4 deletions(-)

-- 
2.21.0


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

* [PATCH 0/2] reset: meson-audio-arb: add sm1 support
@ 2019-08-20  9:46 ` Jerome Brunet
  0 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20  9:46 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Kevin Hilman, linux-amlogic, linux-kernel, devicetree, Jerome Brunet

This patchset adds the new arb reset lines for the sm1 SoC family

Jerome Brunet (2):
  reset: dt-bindings: meson: update arb bindings for sm1
  reset: meson-audio-arb: add sm1 support

 .../reset/amlogic,meson-axg-audio-arb.txt     |  3 +-
 drivers/reset/reset-meson-audio-arb.c         | 28 +++++++++++++++++--
 .../reset/amlogic,meson-axg-audio-arb.h       |  2 ++
 3 files changed, 29 insertions(+), 4 deletions(-)

-- 
2.21.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH 1/2] reset: dt-bindings: meson: update arb bindings for sm1
  2019-08-20  9:46 ` Jerome Brunet
@ 2019-08-20  9:46   ` Jerome Brunet
  -1 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20  9:46 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Jerome Brunet, Kevin Hilman, linux-amlogic, devicetree, linux-kernel

SM1 SoC family adds two new audio FIFOs with the related arb reset lines

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 .../devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt  | 3 ++-
 include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h        | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt b/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt
index 26e542eb96df..43e580ef64ba 100644
--- a/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt
+++ b/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt
@@ -4,7 +4,8 @@ The Amlogic Audio ARB is a simple device which enables or
 disables the access of Audio FIFOs to DDR on AXG based SoC.
 
 Required properties:
-- compatible: 'amlogic,meson-axg-audio-arb'
+- compatible: 'amlogic,meson-axg-audio-arb' or
+	      'amlogic,meson-sm1-audio-arb'
 - reg: physical base address of the controller and length of memory
        mapped region.
 - clocks: phandle to the fifo peripheral clock provided by the audio
diff --git a/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h b/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h
index 05c36367875c..1ef807856cb8 100644
--- a/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h
+++ b/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h
@@ -13,5 +13,7 @@
 #define AXG_ARB_FRDDR_A	3
 #define AXG_ARB_FRDDR_B	4
 #define AXG_ARB_FRDDR_C	5
+#define AXG_ARB_TODDR_D	6
+#define AXG_ARB_FRDDR_D	7
 
 #endif /* _DT_BINDINGS_AMLOGIC_MESON_AXG_AUDIO_ARB_H */
-- 
2.21.0


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

* [PATCH 1/2] reset: dt-bindings: meson: update arb bindings for sm1
@ 2019-08-20  9:46   ` Jerome Brunet
  0 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20  9:46 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Kevin Hilman, linux-amlogic, linux-kernel, devicetree, Jerome Brunet

SM1 SoC family adds two new audio FIFOs with the related arb reset lines

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 .../devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt  | 3 ++-
 include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h        | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt b/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt
index 26e542eb96df..43e580ef64ba 100644
--- a/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt
+++ b/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt
@@ -4,7 +4,8 @@ The Amlogic Audio ARB is a simple device which enables or
 disables the access of Audio FIFOs to DDR on AXG based SoC.
 
 Required properties:
-- compatible: 'amlogic,meson-axg-audio-arb'
+- compatible: 'amlogic,meson-axg-audio-arb' or
+	      'amlogic,meson-sm1-audio-arb'
 - reg: physical base address of the controller and length of memory
        mapped region.
 - clocks: phandle to the fifo peripheral clock provided by the audio
diff --git a/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h b/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h
index 05c36367875c..1ef807856cb8 100644
--- a/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h
+++ b/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h
@@ -13,5 +13,7 @@
 #define AXG_ARB_FRDDR_A	3
 #define AXG_ARB_FRDDR_B	4
 #define AXG_ARB_FRDDR_C	5
+#define AXG_ARB_TODDR_D	6
+#define AXG_ARB_FRDDR_D	7
 
 #endif /* _DT_BINDINGS_AMLOGIC_MESON_AXG_AUDIO_ARB_H */
-- 
2.21.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH 2/2] reset: meson-audio-arb: add sm1 support
  2019-08-20  9:46 ` Jerome Brunet
@ 2019-08-20  9:46   ` Jerome Brunet
  -1 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20  9:46 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Jerome Brunet, Kevin Hilman, linux-amlogic, devicetree, linux-kernel

Add the new arb reset lines of the SM1 SoC family

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/reset/reset-meson-audio-arb.c | 28 ++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
index c53a2185a039..72d29dbca45a 100644
--- a/drivers/reset/reset-meson-audio-arb.c
+++ b/drivers/reset/reset-meson-audio-arb.c
@@ -30,6 +30,17 @@ static const unsigned int axg_audio_arb_reset_bits[] = {
 	[AXG_ARB_FRDDR_C]	= 6,
 };
 
+static const unsigned int sm1_audio_arb_reset_bits[] = {
+	[AXG_ARB_TODDR_A]	= 0,
+	[AXG_ARB_TODDR_B]	= 1,
+	[AXG_ARB_TODDR_C]	= 2,
+	[AXG_ARB_FRDDR_A]	= 4,
+	[AXG_ARB_FRDDR_B]	= 5,
+	[AXG_ARB_FRDDR_C]	= 6,
+	[AXG_ARB_TODDR_D]	= 3,
+	[AXG_ARB_FRDDR_D]	= 7,
+};
+
 static int meson_audio_arb_update(struct reset_controller_dev *rcdev,
 				  unsigned long id, bool assert)
 {
@@ -82,8 +93,14 @@ static const struct reset_control_ops meson_audio_arb_rstc_ops = {
 };
 
 static const struct of_device_id meson_audio_arb_of_match[] = {
-	{ .compatible = "amlogic,meson-axg-audio-arb", },
-	{}
+	{
+		.compatible = "amlogic,meson-axg-audio-arb",
+		.data = axg_audio_arb_reset_bits,
+	},
+	{
+		.compatible = "amlogic,meson-sm1-audio-arb",
+		.data = sm1_audio_arb_reset_bits
+	}, {}
 };
 MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match);
 
@@ -104,10 +121,15 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
 static int meson_audio_arb_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	const unsigned int *data;
 	struct meson_audio_arb_data *arb;
 	struct resource *res;
 	int ret;
 
+	data = of_device_get_match_data(dev);
+	if (!data)
+		return -EINVAL;
+
 	arb = devm_kzalloc(dev, sizeof(*arb), GFP_KERNEL);
 	if (!arb)
 		return -ENOMEM;
@@ -126,7 +148,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
 		return PTR_ERR(arb->regs);
 
 	spin_lock_init(&arb->lock);
-	arb->reset_bits = axg_audio_arb_reset_bits;
+	arb->reset_bits = data;
 	arb->rstc.nr_resets = ARRAY_SIZE(axg_audio_arb_reset_bits);
 	arb->rstc.ops = &meson_audio_arb_rstc_ops;
 	arb->rstc.of_node = dev->of_node;
-- 
2.21.0


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

* [PATCH 2/2] reset: meson-audio-arb: add sm1 support
@ 2019-08-20  9:46   ` Jerome Brunet
  0 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20  9:46 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Kevin Hilman, linux-amlogic, linux-kernel, devicetree, Jerome Brunet

Add the new arb reset lines of the SM1 SoC family

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/reset/reset-meson-audio-arb.c | 28 ++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
index c53a2185a039..72d29dbca45a 100644
--- a/drivers/reset/reset-meson-audio-arb.c
+++ b/drivers/reset/reset-meson-audio-arb.c
@@ -30,6 +30,17 @@ static const unsigned int axg_audio_arb_reset_bits[] = {
 	[AXG_ARB_FRDDR_C]	= 6,
 };
 
+static const unsigned int sm1_audio_arb_reset_bits[] = {
+	[AXG_ARB_TODDR_A]	= 0,
+	[AXG_ARB_TODDR_B]	= 1,
+	[AXG_ARB_TODDR_C]	= 2,
+	[AXG_ARB_FRDDR_A]	= 4,
+	[AXG_ARB_FRDDR_B]	= 5,
+	[AXG_ARB_FRDDR_C]	= 6,
+	[AXG_ARB_TODDR_D]	= 3,
+	[AXG_ARB_FRDDR_D]	= 7,
+};
+
 static int meson_audio_arb_update(struct reset_controller_dev *rcdev,
 				  unsigned long id, bool assert)
 {
@@ -82,8 +93,14 @@ static const struct reset_control_ops meson_audio_arb_rstc_ops = {
 };
 
 static const struct of_device_id meson_audio_arb_of_match[] = {
-	{ .compatible = "amlogic,meson-axg-audio-arb", },
-	{}
+	{
+		.compatible = "amlogic,meson-axg-audio-arb",
+		.data = axg_audio_arb_reset_bits,
+	},
+	{
+		.compatible = "amlogic,meson-sm1-audio-arb",
+		.data = sm1_audio_arb_reset_bits
+	}, {}
 };
 MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match);
 
@@ -104,10 +121,15 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
 static int meson_audio_arb_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	const unsigned int *data;
 	struct meson_audio_arb_data *arb;
 	struct resource *res;
 	int ret;
 
+	data = of_device_get_match_data(dev);
+	if (!data)
+		return -EINVAL;
+
 	arb = devm_kzalloc(dev, sizeof(*arb), GFP_KERNEL);
 	if (!arb)
 		return -ENOMEM;
@@ -126,7 +148,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
 		return PTR_ERR(arb->regs);
 
 	spin_lock_init(&arb->lock);
-	arb->reset_bits = axg_audio_arb_reset_bits;
+	arb->reset_bits = data;
 	arb->rstc.nr_resets = ARRAY_SIZE(axg_audio_arb_reset_bits);
 	arb->rstc.ops = &meson_audio_arb_rstc_ops;
 	arb->rstc.of_node = dev->of_node;
-- 
2.21.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 2/2] reset: meson-audio-arb: add sm1 support
  2019-08-20  9:46   ` Jerome Brunet
@ 2019-08-20 15:39     ` Philipp Zabel
  -1 siblings, 0 replies; 13+ messages in thread
From: Philipp Zabel @ 2019-08-20 15:39 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: Kevin Hilman, linux-amlogic, devicetree, linux-kernel

Hi Jerome,

thank you for the patch. Just one nitpick and one real issue below:

On Tue, 2019-08-20 at 11:46 +0200, Jerome Brunet wrote:
> Add the new arb reset lines of the SM1 SoC family
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/reset/reset-meson-audio-arb.c | 28 ++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
> index c53a2185a039..72d29dbca45a 100644
> --- a/drivers/reset/reset-meson-audio-arb.c
> +++ b/drivers/reset/reset-meson-audio-arb.c
> @@ -30,6 +30,17 @@ static const unsigned int axg_audio_arb_reset_bits[] = {
>  	[AXG_ARB_FRDDR_C]	= 6,
>  };
>  
> +static const unsigned int sm1_audio_arb_reset_bits[] = {
> +	[AXG_ARB_TODDR_A]	= 0,
> +	[AXG_ARB_TODDR_B]	= 1,
> +	[AXG_ARB_TODDR_C]	= 2,
> +	[AXG_ARB_FRDDR_A]	= 4,
> +	[AXG_ARB_FRDDR_B]	= 5,
> +	[AXG_ARB_FRDDR_C]	= 6,
> +	[AXG_ARB_TODDR_D]	= 3,
> +	[AXG_ARB_FRDDR_D]	= 7,
> +};
> +
>  static int meson_audio_arb_update(struct reset_controller_dev *rcdev,
>  				  unsigned long id, bool assert)
>  {
> @@ -82,8 +93,14 @@ static const struct reset_control_ops meson_audio_arb_rstc_ops = {
>  };
>  
>  static const struct of_device_id meson_audio_arb_of_match[] = {
> -	{ .compatible = "amlogic,meson-axg-audio-arb", },
> -	{}
> +	{
> +		.compatible = "amlogic,meson-axg-audio-arb",
> +		.data = axg_audio_arb_reset_bits,
> +	},
> +	{
> +		.compatible = "amlogic,meson-sm1-audio-arb",
> +		.data = sm1_audio_arb_reset_bits
> +	}, {}

Only slight preference, I would keep the sentinel on a separate line.
Your choice.

>  };
>  MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match);
>  
> @@ -104,10 +121,15 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
>  static int meson_audio_arb_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> +	const unsigned int *data;
>  	struct meson_audio_arb_data *arb;
>  	struct resource *res;
>  	int ret;
>  
> +	data = of_device_get_match_data(dev);
> +	if (!data)
> +		return -EINVAL;
> +
>  	arb = devm_kzalloc(dev, sizeof(*arb), GFP_KERNEL);
>  	if (!arb)
>  		return -ENOMEM;
> @@ -126,7 +148,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
>  		return PTR_ERR(arb->regs);
>  
>  	spin_lock_init(&arb->lock);
> -	arb->reset_bits = axg_audio_arb_reset_bits;
> +	arb->reset_bits = data;
>  	arb->rstc.nr_resets = ARRAY_SIZE(axg_audio_arb_reset_bits);

Since SM1 has two more resets, this needs to come from device match data
as well, or the last two resets will be unusable.

>  	arb->rstc.ops = &meson_audio_arb_rstc_ops;
>  	arb->rstc.of_node = dev->of_node;

regards
Philipp

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

* Re: [PATCH 2/2] reset: meson-audio-arb: add sm1 support
@ 2019-08-20 15:39     ` Philipp Zabel
  0 siblings, 0 replies; 13+ messages in thread
From: Philipp Zabel @ 2019-08-20 15:39 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: Kevin Hilman, devicetree, linux-kernel, linux-amlogic

Hi Jerome,

thank you for the patch. Just one nitpick and one real issue below:

On Tue, 2019-08-20 at 11:46 +0200, Jerome Brunet wrote:
> Add the new arb reset lines of the SM1 SoC family
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/reset/reset-meson-audio-arb.c | 28 ++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
> index c53a2185a039..72d29dbca45a 100644
> --- a/drivers/reset/reset-meson-audio-arb.c
> +++ b/drivers/reset/reset-meson-audio-arb.c
> @@ -30,6 +30,17 @@ static const unsigned int axg_audio_arb_reset_bits[] = {
>  	[AXG_ARB_FRDDR_C]	= 6,
>  };
>  
> +static const unsigned int sm1_audio_arb_reset_bits[] = {
> +	[AXG_ARB_TODDR_A]	= 0,
> +	[AXG_ARB_TODDR_B]	= 1,
> +	[AXG_ARB_TODDR_C]	= 2,
> +	[AXG_ARB_FRDDR_A]	= 4,
> +	[AXG_ARB_FRDDR_B]	= 5,
> +	[AXG_ARB_FRDDR_C]	= 6,
> +	[AXG_ARB_TODDR_D]	= 3,
> +	[AXG_ARB_FRDDR_D]	= 7,
> +};
> +
>  static int meson_audio_arb_update(struct reset_controller_dev *rcdev,
>  				  unsigned long id, bool assert)
>  {
> @@ -82,8 +93,14 @@ static const struct reset_control_ops meson_audio_arb_rstc_ops = {
>  };
>  
>  static const struct of_device_id meson_audio_arb_of_match[] = {
> -	{ .compatible = "amlogic,meson-axg-audio-arb", },
> -	{}
> +	{
> +		.compatible = "amlogic,meson-axg-audio-arb",
> +		.data = axg_audio_arb_reset_bits,
> +	},
> +	{
> +		.compatible = "amlogic,meson-sm1-audio-arb",
> +		.data = sm1_audio_arb_reset_bits
> +	}, {}

Only slight preference, I would keep the sentinel on a separate line.
Your choice.

>  };
>  MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match);
>  
> @@ -104,10 +121,15 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
>  static int meson_audio_arb_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> +	const unsigned int *data;
>  	struct meson_audio_arb_data *arb;
>  	struct resource *res;
>  	int ret;
>  
> +	data = of_device_get_match_data(dev);
> +	if (!data)
> +		return -EINVAL;
> +
>  	arb = devm_kzalloc(dev, sizeof(*arb), GFP_KERNEL);
>  	if (!arb)
>  		return -ENOMEM;
> @@ -126,7 +148,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
>  		return PTR_ERR(arb->regs);
>  
>  	spin_lock_init(&arb->lock);
> -	arb->reset_bits = axg_audio_arb_reset_bits;
> +	arb->reset_bits = data;
>  	arb->rstc.nr_resets = ARRAY_SIZE(axg_audio_arb_reset_bits);

Since SM1 has two more resets, this needs to come from device match data
as well, or the last two resets will be unusable.

>  	arb->rstc.ops = &meson_audio_arb_rstc_ops;
>  	arb->rstc.of_node = dev->of_node;

regards
Philipp

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 2/2] reset: meson-audio-arb: add sm1 support
  2019-08-20 15:39     ` Philipp Zabel
@ 2019-08-20 15:58       ` Jerome Brunet
  -1 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20 15:58 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: Kevin Hilman, linux-amlogic, devicetree, linux-kernel

On Tue 20 Aug 2019 at 17:39, Philipp Zabel <p.zabel@pengutronix.de> wrote:

> Hi Jerome,
>
> thank you for the patch. Just one nitpick and one real issue below:
>
> On Tue, 2019-08-20 at 11:46 +0200, Jerome Brunet wrote:
>> Add the new arb reset lines of the SM1 SoC family
>> 
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>  drivers/reset/reset-meson-audio-arb.c | 28 ++++++++++++++++++++++++---
>>  1 file changed, 25 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
>> index c53a2185a039..72d29dbca45a 100644
>> --- a/drivers/reset/reset-meson-audio-arb.c
>> +++ b/drivers/reset/reset-meson-audio-arb.c
>> @@ -30,6 +30,17 @@ static const unsigned int axg_audio_arb_reset_bits[] = {
>>  	[AXG_ARB_FRDDR_C]	= 6,
>>  };
>>  
>> +static const unsigned int sm1_audio_arb_reset_bits[] = {
>> +	[AXG_ARB_TODDR_A]	= 0,
>> +	[AXG_ARB_TODDR_B]	= 1,
>> +	[AXG_ARB_TODDR_C]	= 2,
>> +	[AXG_ARB_FRDDR_A]	= 4,
>> +	[AXG_ARB_FRDDR_B]	= 5,
>> +	[AXG_ARB_FRDDR_C]	= 6,
>> +	[AXG_ARB_TODDR_D]	= 3,
>> +	[AXG_ARB_FRDDR_D]	= 7,
>> +};
>> +
>>  static int meson_audio_arb_update(struct reset_controller_dev *rcdev,
>>  				  unsigned long id, bool assert)
>>  {
>> @@ -82,8 +93,14 @@ static const struct reset_control_ops meson_audio_arb_rstc_ops = {
>>  };
>>  
>>  static const struct of_device_id meson_audio_arb_of_match[] = {
>> -	{ .compatible = "amlogic,meson-axg-audio-arb", },
>> -	{}
>> +	{
>> +		.compatible = "amlogic,meson-axg-audio-arb",
>> +		.data = axg_audio_arb_reset_bits,
>> +	},
>> +	{
>> +		.compatible = "amlogic,meson-sm1-audio-arb",
>> +		.data = sm1_audio_arb_reset_bits
>> +	}, {}
>
> Only slight preference, I would keep the sentinel on a separate line.
> Your choice.

Agreed.

>
>>  };
>>  MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match);
>>  
>> @@ -104,10 +121,15 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
>>  static int meson_audio_arb_probe(struct platform_device *pdev)
>>  {
>>  	struct device *dev = &pdev->dev;
>> +	const unsigned int *data;
>>  	struct meson_audio_arb_data *arb;
>>  	struct resource *res;
>>  	int ret;
>>  
>> +	data = of_device_get_match_data(dev);
>> +	if (!data)
>> +		return -EINVAL;
>> +
>>  	arb = devm_kzalloc(dev, sizeof(*arb), GFP_KERNEL);
>>  	if (!arb)
>>  		return -ENOMEM;
>> @@ -126,7 +148,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
>>  		return PTR_ERR(arb->regs);
>>  
>>  	spin_lock_init(&arb->lock);
>> -	arb->reset_bits = axg_audio_arb_reset_bits;
>> +	arb->reset_bits = data;
>>  	arb->rstc.nr_resets = ARRAY_SIZE(axg_audio_arb_reset_bits);
>
> Since SM1 has two more resets, this needs to come from device match data
> as well, or the last two resets will be unusable.

Absolutely. Sorry about that.
We are still a bit early in process of adding the support for this SoC.

I'll wait until I can do more complete tests to send a v2.

>
>>  	arb->rstc.ops = &meson_audio_arb_rstc_ops;
>>  	arb->rstc.of_node = dev->of_node;
>
> regards
> Philipp

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

* Re: [PATCH 2/2] reset: meson-audio-arb: add sm1 support
@ 2019-08-20 15:58       ` Jerome Brunet
  0 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2019-08-20 15:58 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: Kevin Hilman, devicetree, linux-kernel, linux-amlogic

On Tue 20 Aug 2019 at 17:39, Philipp Zabel <p.zabel@pengutronix.de> wrote:

> Hi Jerome,
>
> thank you for the patch. Just one nitpick and one real issue below:
>
> On Tue, 2019-08-20 at 11:46 +0200, Jerome Brunet wrote:
>> Add the new arb reset lines of the SM1 SoC family
>> 
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>  drivers/reset/reset-meson-audio-arb.c | 28 ++++++++++++++++++++++++---
>>  1 file changed, 25 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
>> index c53a2185a039..72d29dbca45a 100644
>> --- a/drivers/reset/reset-meson-audio-arb.c
>> +++ b/drivers/reset/reset-meson-audio-arb.c
>> @@ -30,6 +30,17 @@ static const unsigned int axg_audio_arb_reset_bits[] = {
>>  	[AXG_ARB_FRDDR_C]	= 6,
>>  };
>>  
>> +static const unsigned int sm1_audio_arb_reset_bits[] = {
>> +	[AXG_ARB_TODDR_A]	= 0,
>> +	[AXG_ARB_TODDR_B]	= 1,
>> +	[AXG_ARB_TODDR_C]	= 2,
>> +	[AXG_ARB_FRDDR_A]	= 4,
>> +	[AXG_ARB_FRDDR_B]	= 5,
>> +	[AXG_ARB_FRDDR_C]	= 6,
>> +	[AXG_ARB_TODDR_D]	= 3,
>> +	[AXG_ARB_FRDDR_D]	= 7,
>> +};
>> +
>>  static int meson_audio_arb_update(struct reset_controller_dev *rcdev,
>>  				  unsigned long id, bool assert)
>>  {
>> @@ -82,8 +93,14 @@ static const struct reset_control_ops meson_audio_arb_rstc_ops = {
>>  };
>>  
>>  static const struct of_device_id meson_audio_arb_of_match[] = {
>> -	{ .compatible = "amlogic,meson-axg-audio-arb", },
>> -	{}
>> +	{
>> +		.compatible = "amlogic,meson-axg-audio-arb",
>> +		.data = axg_audio_arb_reset_bits,
>> +	},
>> +	{
>> +		.compatible = "amlogic,meson-sm1-audio-arb",
>> +		.data = sm1_audio_arb_reset_bits
>> +	}, {}
>
> Only slight preference, I would keep the sentinel on a separate line.
> Your choice.

Agreed.

>
>>  };
>>  MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match);
>>  
>> @@ -104,10 +121,15 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
>>  static int meson_audio_arb_probe(struct platform_device *pdev)
>>  {
>>  	struct device *dev = &pdev->dev;
>> +	const unsigned int *data;
>>  	struct meson_audio_arb_data *arb;
>>  	struct resource *res;
>>  	int ret;
>>  
>> +	data = of_device_get_match_data(dev);
>> +	if (!data)
>> +		return -EINVAL;
>> +
>>  	arb = devm_kzalloc(dev, sizeof(*arb), GFP_KERNEL);
>>  	if (!arb)
>>  		return -ENOMEM;
>> @@ -126,7 +148,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
>>  		return PTR_ERR(arb->regs);
>>  
>>  	spin_lock_init(&arb->lock);
>> -	arb->reset_bits = axg_audio_arb_reset_bits;
>> +	arb->reset_bits = data;
>>  	arb->rstc.nr_resets = ARRAY_SIZE(axg_audio_arb_reset_bits);
>
> Since SM1 has two more resets, this needs to come from device match data
> as well, or the last two resets will be unusable.

Absolutely. Sorry about that.
We are still a bit early in process of adding the support for this SoC.

I'll wait until I can do more complete tests to send a v2.

>
>>  	arb->rstc.ops = &meson_audio_arb_rstc_ops;
>>  	arb->rstc.of_node = dev->of_node;
>
> regards
> Philipp

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 1/2] reset: dt-bindings: meson: update arb bindings for sm1
  2019-08-20  9:46   ` Jerome Brunet
  (?)
@ 2019-08-27 17:03     ` Rob Herring
  -1 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2019-08-27 17:03 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Philipp Zabel, Jerome Brunet, Kevin Hilman, linux-amlogic,
	devicetree, linux-kernel

On Tue, 20 Aug 2019 11:46:24 +0200, Jerome Brunet wrote:
> SM1 SoC family adds two new audio FIFOs with the related arb reset lines
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  .../devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt  | 3 ++-
>  include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h        | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 1/2] reset: dt-bindings: meson: update arb bindings for sm1
@ 2019-08-27 17:03     ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2019-08-27 17:03 UTC (permalink / raw)
  Cc: Philipp Zabel, Jerome Brunet, Kevin Hilman, linux-amlogic,
	devicetree, linux-kernel

On Tue, 20 Aug 2019 11:46:24 +0200, Jerome Brunet wrote:
> SM1 SoC family adds two new audio FIFOs with the related arb reset lines
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  .../devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt  | 3 ++-
>  include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h        | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 1/2] reset: dt-bindings: meson: update arb bindings for sm1
@ 2019-08-27 17:03     ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2019-08-27 17:03 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: devicetree, Kevin Hilman, linux-kernel, Philipp Zabel,
	linux-amlogic, Jerome Brunet

On Tue, 20 Aug 2019 11:46:24 +0200, Jerome Brunet wrote:
> SM1 SoC family adds two new audio FIFOs with the related arb reset lines
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  .../devicetree/bindings/reset/amlogic,meson-axg-audio-arb.txt  | 3 ++-
>  include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h        | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2019-08-27 17:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20  9:46 [PATCH 0/2] reset: meson-audio-arb: add sm1 support Jerome Brunet
2019-08-20  9:46 ` Jerome Brunet
2019-08-20  9:46 ` [PATCH 1/2] reset: dt-bindings: meson: update arb bindings for sm1 Jerome Brunet
2019-08-20  9:46   ` Jerome Brunet
2019-08-27 17:03   ` Rob Herring
2019-08-27 17:03     ` Rob Herring
2019-08-27 17:03     ` Rob Herring
2019-08-20  9:46 ` [PATCH 2/2] reset: meson-audio-arb: add sm1 support Jerome Brunet
2019-08-20  9:46   ` Jerome Brunet
2019-08-20 15:39   ` Philipp Zabel
2019-08-20 15:39     ` Philipp Zabel
2019-08-20 15:58     ` Jerome Brunet
2019-08-20 15:58       ` Jerome Brunet

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.