[RFC,v2,4/7] i2c: demux: WIP: handle the new atomic callbacks
diff mbox series

Message ID 20190302134735.4393-5-wsa+renesas@sang-engineering.com
State Deferred
Headers show
Series
  • i2c: core: introduce atomic transfers
Related show

Commit Message

Wolfram Sang March 2, 2019, 1:47 p.m. UTC
If the parent has an atomic callback, we need to translate it the same
way as the non-atomic callback.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/muxes/i2c-demux-pinctrl.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Simon Horman March 15, 2019, 12:32 p.m. UTC | #1
On Sat, Mar 02, 2019 at 02:47:32PM +0100, Wolfram Sang wrote:
> If the parent has an atomic callback, we need to translate it the same
> way as the non-atomic callback.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/i2c/muxes/i2c-demux-pinctrl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c
> index 035032e20327..5d00adfbe578 100644
> --- a/drivers/i2c/muxes/i2c-demux-pinctrl.c
> +++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c
> @@ -99,6 +99,9 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne
>  
>  	/* Now fill out current adapter structure. cur_chan must be up to date */
>  	priv->algo.master_xfer = i2c_demux_master_xfer;
> +	/* FIXME: regular muxes need proper handling, too! */
> +	if (adap->algo->master_xfer_atomic)
> +		priv->algo.master_xfer_atomic = i2c_demux_master_xfer;
>  	priv->algo.functionality = i2c_demux_functionality;
>  
>  	snprintf(priv->cur_adap.name, sizeof(priv->cur_adap.name),
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

Patch
diff mbox series

diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c
index 035032e20327..5d00adfbe578 100644
--- a/drivers/i2c/muxes/i2c-demux-pinctrl.c
+++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c
@@ -99,6 +99,9 @@  static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne
 
 	/* Now fill out current adapter structure. cur_chan must be up to date */
 	priv->algo.master_xfer = i2c_demux_master_xfer;
+	/* FIXME: regular muxes need proper handling, too! */
+	if (adap->algo->master_xfer_atomic)
+		priv->algo.master_xfer_atomic = i2c_demux_master_xfer;
 	priv->algo.functionality = i2c_demux_functionality;
 
 	snprintf(priv->cur_adap.name, sizeof(priv->cur_adap.name),