[Nouveau] [PATCH 1/2] power sensor support

Ilia Mirkin imirkin at alum.mit.edu
Wed Feb 17 16:12:10 UTC 2016


On Wed, Feb 17, 2016 at 11:04 AM, Karol Herbst <nouveau at karolherbst.de> wrote:
> @@ -122,6 +138,21 @@ nvkm_wri2cr(struct i2c_adapter *adap, u8 addr, u8 reg, u8 val)
>         return 0;
>  }
>
> +static inline int
> +nv_wri162cr(struct i2c_adapter *adap, u8 addr, u8 reg, u16 val)
> +{
> +       u8 buf[3] = { reg, val >> 8, val & 0xff};
> +       struct i2c_msg msgs[] = {
> +               { .addr = addr, .flags = 0, .len = 3, .buf = buf },
> +       };
> +
> +       int ret = i2c_transfer(adap, msgs, ARRAY_SIZE(msgs));
> +       if (ret != 1)
> +               return -EIO;
> +
> +       return 0;
> +}

That should probably be nv_wr16i2cr?


More information about the Nouveau mailing list