From: Sam Ravnborg <sam@ravnborg.org>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v1 5/5] tinydrm: add winstar wg160160 driver
Date: Wed, 8 Aug 2018 10:32:38 +0200 [thread overview]
Message-ID: <20180808083238.GA17613@ravnborg.org> (raw)
In-Reply-To: <16dfa544-e454-f59b-91ef-9bac7bf1b490@tronnes.org>
Hi Noralf.
On Tue, Aug 07, 2018 at 07:35:30PM +0200, Noralf Trønnes wrote:
>
> Den 02.08.2018 21.45, skrev Sam Ravnborg:
> >Add driver for the winstar wg160160 display.
> >The driver utilises pardata-dbi that
> >again utilise the pardata subsystem.
> >
> >Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> >---
> > MAINTAINERS | 5 +
> > drivers/gpu/drm/tinydrm/Kconfig | 10 ++
> > drivers/gpu/drm/tinydrm/Makefile | 1 +
> > drivers/gpu/drm/tinydrm/wg160160.c | 298 +++++++++++++++++++++++++++++++++++++
> > 4 files changed, 314 insertions(+)
> > create mode 100644 drivers/gpu/drm/tinydrm/wg160160.c
> >
>
> [...]
>
> >+
> >+/**
> >+ * write_reg - Write instruction on parallel bus to controller
> >+ *
> >+ * Check BUSY flag and write instruction
> >+ *
> >+ * @pdd: pardata data
> >+ * @reg: The register to write
> >+ * @value: The value of the register
> >+ *
> >+ * Returns:
> >+ * Zero on success, negative error code on failure
> >+ */
> >+int write_reg(struct pardata_data *pdd, unsigned int reg, unsigned int value)
> >+{
> >+ int ins[PIN_NUM];
> >+ int val[PIN_NUM];
> >+ int i;
> >+
> >+ for (i = 0; i < PIN_NUM; i++)
> >+ ins[PIN_DB0 + i] = !!BIT(reg);
> >+
> >+ for (i = 0; i < PIN_NUM; i++)
> >+ val[PIN_DB0 + i] = !!(value & BIT(i));
> >+
> >+ gpiod_set_value_cansleep(pdd->bus->pin_rs, 1);
> >+ gpiod_set_array_value_cansleep(PIN_NUM, pdd->bus->data_pins->desc, ins);
> >+ wait_busy(pdd);
> >+ pardata_strobe_write(pdd);
> >+
> >+ gpiod_set_value_cansleep(pdd->bus->pin_rs, 0);
> >+ gpiod_set_array_value_cansleep(PIN_NUM, pdd->bus->data_pins->desc, val);
> >+ wait_busy(pdd);
> >+ pardata_strobe_write(pdd);
> >+
> >+ return 0;
> >+}
>
> If this controller has normal registers, you could do a regmap
> implementation for pardata: drivers/base/regmap.
If I understand you correct then you suggest to add a regmap implementation
on top of the registers replacing the current gpio support?
So we in regmap can optimize access to the registers better.
Or did you have something else in mind?
As speed is not the main challenge here I will likely wait with this
and continue using gpio.
Sam
next prev parent reply other threads:[~2018-08-08 8:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 19:39 [RFC PATCH v1 0/5] Add pardata bus + tinydrm driver Sam Ravnborg
2018-08-02 19:45 ` [PATCH v1 1/5] dt-bindings: add parallel data bus (pardata) Sam Ravnborg
2018-08-02 19:45 ` [PATCH v1 2/5] pardata: new bus for parallel data access Sam Ravnborg
2018-08-07 16:40 ` Noralf Trønnes
2018-08-08 8:24 ` Sam Ravnborg
2018-08-08 16:22 ` Noralf Trønnes
2020-01-20 10:10 ` Geert Uytterhoeven
2020-01-20 18:48 ` Sam Ravnborg
2020-01-20 19:12 ` Geert Uytterhoeven
2020-01-20 19:23 ` Sam Ravnborg
2018-08-02 19:45 ` [PATCH v1 3/5] tinydrm: add support for parallel data displays Sam Ravnborg
2018-08-02 19:45 ` [PATCH v1 4/5] dt-bindings: add winstar,wg160160 display bindings Sam Ravnborg
2018-08-02 19:45 ` [PATCH v1 5/5] tinydrm: add winstar wg160160 driver Sam Ravnborg
2018-08-06 9:15 ` Dan Carpenter
2018-08-06 12:07 ` Sam Ravnborg
2018-08-07 17:35 ` Noralf Trønnes
2018-08-08 8:32 ` Sam Ravnborg [this message]
2018-08-08 16:31 ` Noralf Trønnes
2018-08-02 19:46 ` [RFC PATCH v1 0/5] Add pardata bus + tinydrm driver Miguel Ojeda
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=20180808083238.GA17613@ravnborg.org \
--to=sam@ravnborg.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noralf@tronnes.org \
/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