public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy@kernel.org>
To: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: geert@linux-m68k.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	andrew@lunn.ch, gregory.clement@bootlin.com,
	sebastian.hesselbarth@gmail.com, pavel@ucw.cz, lee@kernel.org,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/4] auxdisplay: Add 7-segment LED display driver
Date: Fri, 1 Mar 2024 20:18:37 +0200	[thread overview]
Message-ID: <ZeIb_TaKK1DE6l6U@smile.fi.intel.com> (raw)
In-Reply-To: <20240301014203.2033844-2-chris.packham@alliedtelesis.co.nz>

On Fri, Mar 01, 2024 at 02:42:00PM +1300, Chris Packham wrote:
> Add a driver for a 7-segment LED display. At the moment only one
> character is supported but it should be possible to expand this to
> support more characters and/or 14-segment displays in the future.

...

> + * Driver for a 7 segment LED display

7-segment

...

> + * The GPIOs are wired to the 7 segments in a clockwise fashion starting from
> + * the top.

Not exactly. They can wire them as they wish, we just need to agree on the
sequence of the segments in DT to be mapped to the 7-segment diagram.

...

> + *      -a-
> + *     |   |
> + *     f   b
> + *     |   |
> + *      -g-
> + *     |   |
> + *     e   c
> + *     |   |
> + *      -d-

I would drop this as it's available in UAPI header...

...

> +#include <linux/bitmap.h>
> +#include <linux/container_of.h>
> +#include <linux/errno.h>
> +#include <linux/gpio/consumer.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/types.h>
> +#include <linux/workqueue.h>

...which you forgot to include here.

...

> +static void seg_led_update(struct work_struct *work)
> +{
> +	struct seg_led_priv *priv = container_of(work, struct seg_led_priv, work.work);
> +	struct linedisp *linedisp = &priv->linedisp;
> +	struct linedisp_map *map = linedisp->map;
> +	DECLARE_BITMAP(values, 8);

> +	bitmap_zero(values, 8);

Why do you need this zeroing?

> +	bitmap_set_value8(values, map_to_seg7(&map->map.seg7, linedisp->buf[0]), 0);
> +
> +	gpiod_set_array_value_cansleep(priv->segment_gpios->ndescs, priv->segment_gpios->desc,
> +				       priv->segment_gpios->info, values);
> +}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-03-01 18:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  1:41 [PATCH v3 0/4] auxdisplay: 7 segment LED display Chris Packham
2024-03-01  1:42 ` [PATCH v3 1/4] auxdisplay: Add 7-segment LED display driver Chris Packham
2024-03-01 18:18   ` Andy Shevchenko [this message]
2024-03-03 19:58     ` Chris Packham
2024-03-03 20:35       ` Andy Shevchenko
2024-03-03 20:56         ` Yury Norov
2024-03-04  0:45     ` Chris Packham
2024-03-04  0:46       ` Chris Packham
2024-03-01  1:42 ` [PATCH v3 2/4] dt-bindings: auxdisplay: Add bindings for generic 7-segment LED Chris Packham
2024-03-01 18:21   ` Andy Shevchenko
2024-03-01  1:42 ` [PATCH v3 3/4] ARM: dts: marvell: Add 7-segment LED display on x530 Chris Packham
2024-03-01 18:22   ` Andy Shevchenko
2024-03-01  1:42 ` [PATCH v3 4/4] ARM: dts: marvell: Indicate USB activity " Chris Packham
2024-03-01 18:24   ` Andy Shevchenko
2024-03-03  9:48     ` Geert Uytterhoeven
2024-03-03 20:11       ` Chris Packham
2024-03-03 20:43       ` Andy Shevchenko
2024-03-04  9:57         ` Geert Uytterhoeven
2024-03-04 18:17           ` Andy Shevchenko
2024-03-04 19:01             ` Geert Uytterhoeven
2024-03-04 19:16               ` Andy Shevchenko
2024-03-01 18:31 ` [PATCH v3 0/4] auxdisplay: 7 segment LED display Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZeIb_TaKK1DE6l6U@smile.fi.intel.com \
    --to=andy@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gregory.clement@bootlin.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox