Re: [PATCH v3 9/9] auxdisplay: Add driver for MAX695x 7-segment LED controllers

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

 



Hi Andy,

On Mon, Feb 19, 2024 at 6:03 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> Add initial driver for the MAX6958 and MAX6959 7-segment LED
> controllers.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Thanks for your patch!

LGTM, so
Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

> --- /dev/null
> +++ b/drivers/auxdisplay/max6959.c

> +static void max6959_disp_update(struct work_struct *work)
> +{
> +       struct max6959_priv *priv = container_of(work, struct max6959_priv, work.work);
> +       struct linedisp *linedisp = &priv->linedisp;
> +       struct linedisp_map *map = linedisp->map;
> +       char *s = linedisp->buf;
> +       u8 buf[4];
> +
> +       /* Map segments according to datasheet */
> +       buf[0] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;
> +       buf[1] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;
> +       buf[2] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;
> +       buf[3] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;

for (unsigned int i = 0; i < linedisp->num_chars; i++) { ... }

> +
> +       regmap_bulk_write(priv->regmap, REG_DIGIT(0), buf, ARRAY_SIZE(buf));

linedisp->num_chars

> +}

> +static int max6959_i2c_probe(struct i2c_client *client)
> +{
> +       struct device *dev = &client->dev;
> +       struct max6959_priv *priv;
> +       int ret;
> +
> +       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> +       if (!priv)
> +               return -ENOMEM;
> +
> +       priv->regmap = devm_regmap_init_i2c(client, &max6959_regmap_config);
> +       if (IS_ERR(priv->regmap))
> +               return PTR_ERR(priv->regmap);
> +
> +       ret = max6959_power_on(priv);
> +       if (ret)
> +               return ret;
> +
> +       ret = linedisp_register(&priv->linedisp, dev, 4, &max6959_linedisp_ops);

+ device_property_read_u32(dev, "display-width-chars", ...) handling.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux