All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state
@ 2019-01-28  8:47 Mario Six
  2019-01-28  8:47 ` [U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface Mario Six
  2019-03-29  8:41 ` [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state Mario Six
  0 siblings, 2 replies; 4+ messages in thread
From: Mario Six @ 2019-01-28  8:47 UTC (permalink / raw)
  To: u-boot

Make the gdsys_rxaui_ctrl polarity setting function return the old
state to comply with the API requirements.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
---
 drivers/misc/gdsys_rxaui_ctrl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
index 9a63c329bcd..f2c955b13d7 100644
--- a/drivers/misc/gdsys_rxaui_ctrl.c
+++ b/drivers/misc/gdsys_rxaui_ctrl.c
@@ -29,6 +29,7 @@ struct gdsys_rxaui_ctrl_regs {
 
 struct gdsys_rxaui_ctrl_priv {
 	struct regmap *map;
+	bool state;
 };
 
 int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
@@ -36,6 +37,8 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
 	struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
 	u16 state;
 
+	priv->state = !priv->state;
+
 	rxaui_ctrl_get(priv->map, ctrl_1, &state);
 
 	if (val)
@@ -45,7 +48,7 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
 
 	rxaui_ctrl_set(priv->map, ctrl_1, state);
 
-	return 0;
+	return !priv->state;
 }
 
 static const struct misc_ops gdsys_rxaui_ctrl_ops = {
@@ -58,6 +61,8 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
 
 	regmap_init_mem(dev, &priv->map);
 
+	priv->state = false;
+
 	return 0;
 }
 
-- 
2.20.1

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

* [U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface
  2019-01-28  8:47 [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state Mario Six
@ 2019-01-28  8:47 ` Mario Six
  2019-03-29  8:41   ` Mario Six
  2019-03-29  8:41 ` [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state Mario Six
  1 sibling, 1 reply; 4+ messages in thread
From: Mario Six @ 2019-01-28  8:47 UTC (permalink / raw)
  To: u-boot

For the DM case, use the proper parameter for the regmap_init_mem call
(which is the ofnode, not the udevice).

Signed-off-by: Mario Six <mario.six@gdsys.cc>
---
 drivers/misc/gdsys_rxaui_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
index f2c955b13d7..c56abce4d4c 100644
--- a/drivers/misc/gdsys_rxaui_ctrl.c
+++ b/drivers/misc/gdsys_rxaui_ctrl.c
@@ -59,7 +59,7 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
 {
 	struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
 
-	regmap_init_mem(dev, &priv->map);
+	regmap_init_mem(dev_ofnode(dev), &priv->map);
 
 	priv->state = false;
 
-- 
2.20.1

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

* [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state
  2019-01-28  8:47 [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state Mario Six
  2019-01-28  8:47 ` [U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface Mario Six
@ 2019-03-29  8:41 ` Mario Six
  1 sibling, 0 replies; 4+ messages in thread
From: Mario Six @ 2019-03-29  8:41 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 28, 2019 at 9:48 AM Mario Six <mario.six@gdsys.cc> wrote:
>
> Make the gdsys_rxaui_ctrl polarity setting function return the old
> state to comply with the API requirements.
>
> Signed-off-by: Mario Six <mario.six@gdsys.cc>
> ---
>  drivers/misc/gdsys_rxaui_ctrl.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
> index 9a63c329bcd..f2c955b13d7 100644
> --- a/drivers/misc/gdsys_rxaui_ctrl.c
> +++ b/drivers/misc/gdsys_rxaui_ctrl.c
> @@ -29,6 +29,7 @@ struct gdsys_rxaui_ctrl_regs {
>
>  struct gdsys_rxaui_ctrl_priv {
>         struct regmap *map;
> +       bool state;
>  };
>
>  int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
> @@ -36,6 +37,8 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
>         struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
>         u16 state;
>
> +       priv->state = !priv->state;
> +
>         rxaui_ctrl_get(priv->map, ctrl_1, &state);
>
>         if (val)
> @@ -45,7 +48,7 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
>
>         rxaui_ctrl_set(priv->map, ctrl_1, state);
>
> -       return 0;
> +       return !priv->state;
>  }
>
>  static const struct misc_ops gdsys_rxaui_ctrl_ops = {
> @@ -58,6 +61,8 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
>
>         regmap_init_mem(dev, &priv->map);
>
> +       priv->state = false;
> +
>         return 0;
>  }
>
> --
> 2.20.1
>
>

Applied to u-boot-mpc83xx/next.

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

* [U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface
  2019-01-28  8:47 ` [U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface Mario Six
@ 2019-03-29  8:41   ` Mario Six
  0 siblings, 0 replies; 4+ messages in thread
From: Mario Six @ 2019-03-29  8:41 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 28, 2019 at 9:48 AM Mario Six <mario.six@gdsys.cc> wrote:
>
> For the DM case, use the proper parameter for the regmap_init_mem call
> (which is the ofnode, not the udevice).
>
> Signed-off-by: Mario Six <mario.six@gdsys.cc>
> ---
>  drivers/misc/gdsys_rxaui_ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
> index f2c955b13d7..c56abce4d4c 100644
> --- a/drivers/misc/gdsys_rxaui_ctrl.c
> +++ b/drivers/misc/gdsys_rxaui_ctrl.c
> @@ -59,7 +59,7 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
>  {
>         struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
>
> -       regmap_init_mem(dev, &priv->map);
> +       regmap_init_mem(dev_ofnode(dev), &priv->map);
>
>         priv->state = false;
>
> --
> 2.20.1
>
>

Applied to u-boot-mpc83xx/next.

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

end of thread, other threads:[~2019-03-29  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-28  8:47 [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state Mario Six
2019-01-28  8:47 ` [U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface Mario Six
2019-03-29  8:41   ` Mario Six
2019-03-29  8:41 ` [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state Mario Six

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.