Re: [PATCH v5 03/10] gna: read hardware info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Maciej,

thanks for your patch!

Overall I really appreciate the attempt to use DRM, this looks so much
smoother than the previous iterations.

On Thu, Oct 20, 2022 at 7:57 PM Maciej Kwapulinski
<maciej.kwapulinski@xxxxxxxxxxxxxxx> wrote:
>
> From: Tomasz Jankowski <tomasz1.jankowski@xxxxxxxxx>
>
> Get the hardware information from register MMIO_IBUFFS
>
> Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@xxxxxxxxx>
> Tested-by: Mikolaj Grzybowski <mikolajx.grzybowski@xxxxxxxxx>
> Co-developed-by: Jianxun Zhang <jianxun.zhang@xxxxxxxxxxxxxxx>
> Signed-off-by: Jianxun Zhang <jianxun.zhang@xxxxxxxxxxxxxxx>
> Co-developed-by: Maciej Kwapulinski <maciej.kwapulinski@xxxxxxxxxxxxxxx>
> Signed-off-by: Maciej Kwapulinski <maciej.kwapulinski@xxxxxxxxxxxxxxx>

> +static inline u32 gna_reg_read(struct gna_device *gna_priv, u32 reg)
> +{
> +       return readl(gna_priv->iobase + reg);
> +}

If you are consistently using functions like this to read/write registers,
you are just re-implmeneting regmap-mmio, see
drivers/base/regmap/regmap-mmio.c
or look in drivers selecting REGMAP_MMIO and the neat tricks
they do to read/write and update registers with regmap.

Yours,
Linus Walleij



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux