All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastian Hecht <hechtb@gmail.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Linux-SH <linux-sh@vger.kernel.org>,
	linux-serial@vger.kernel.org, Paul Mundt <lethal@linux-sh.org>
Subject: Re: [PATCH 4/5] serial: sh-sci: Add OF support
Date: Fri, 01 Nov 2013 09:47:37 +0000	[thread overview]
Message-ID: <CABYn4sxC02bX7XqN8yQ-gYgZEdaHAUohOjyL3pjGYXK9kd8WXg@mail.gmail.com> (raw)
In-Reply-To: <1383042599-25151-5-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hi Laurent!

> +struct sci_port_info {
> +       unsigned int type;
> +       unsigned int regtype;
> +       unsigned int brr_algo;
> +};
> +
> +static const struct of_device_id of_sci_match[] = {
> +       {
> +               .compatible = "renesas,scif-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_SCIF,
> +                       .regtype = SCIx_SH4_SCIF_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_2,
> +               },
> +       }, {
> +               .compatible = "renesas,scifa-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_SCIFA,
> +                       .regtype = SCIx_SCIFA_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_4,
> +               },
> +       }, {
> +               .compatible = "renesas,scifb-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_SCIFB,
> +                       .regtype = SCIx_SCIFB_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_4,
> +               },
> +       }, {
> +               .compatible = "renesas,hscif-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_HSCIF,
> +                       .regtype = SCIx_HSCIF_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_6,
> +               },
> +       }, {
> +               /* Terminator */
> +       },
> +};
> +MODULE_DEVICE_TABLE(of, of_sci_match);

I like this version way better than my initial approach, given that we
only support ARM based ports and we hope the regtype and brr_algo
won't deviate a lot from the given generic settings for new chips -
else the of_sci_match[] array might become a bit bloated. This was the
former reasoning to introduce all the clumsy OF fields.

I'm happy that the sci OF support will finally make it into the
mainline, thanks Laurent!

Bastian

WARNING: multiple messages have this Message-ID (diff)
From: Bastian Hecht <hechtb@gmail.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Linux-SH <linux-sh@vger.kernel.org>,
	linux-serial@vger.kernel.org, Paul Mundt <lethal@linux-sh.org>
Subject: Re: [PATCH 4/5] serial: sh-sci: Add OF support
Date: Fri, 1 Nov 2013 10:47:37 +0100	[thread overview]
Message-ID: <CABYn4sxC02bX7XqN8yQ-gYgZEdaHAUohOjyL3pjGYXK9kd8WXg@mail.gmail.com> (raw)
In-Reply-To: <1383042599-25151-5-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hi Laurent!

> +struct sci_port_info {
> +       unsigned int type;
> +       unsigned int regtype;
> +       unsigned int brr_algo;
> +};
> +
> +static const struct of_device_id of_sci_match[] = {
> +       {
> +               .compatible = "renesas,scif-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_SCIF,
> +                       .regtype = SCIx_SH4_SCIF_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_2,
> +               },
> +       }, {
> +               .compatible = "renesas,scifa-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_SCIFA,
> +                       .regtype = SCIx_SCIFA_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_4,
> +               },
> +       }, {
> +               .compatible = "renesas,scifb-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_SCIFB,
> +                       .regtype = SCIx_SCIFB_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_4,
> +               },
> +       }, {
> +               .compatible = "renesas,hscif-generic",
> +               .data = (void *)&(const struct sci_port_info) {
> +                       .type = PORT_HSCIF,
> +                       .regtype = SCIx_HSCIF_REGTYPE,
> +                       .brr_algo = SCBRR_ALGO_6,
> +               },
> +       }, {
> +               /* Terminator */
> +       },
> +};
> +MODULE_DEVICE_TABLE(of, of_sci_match);

I like this version way better than my initial approach, given that we
only support ARM based ports and we hope the regtype and brr_algo
won't deviate a lot from the given generic settings for new chips -
else the of_sci_match[] array might become a bit bloated. This was the
former reasoning to introduce all the clumsy OF fields.

I'm happy that the sci OF support will finally make it into the
mainline, thanks Laurent!

Bastian

  reply	other threads:[~2013-11-01  9:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29 10:29 [PATCH 0/5] Add OF support to the sh-sci serial port driver Laurent Pinchart
2013-10-29 10:29 ` Laurent Pinchart
2013-10-29 10:29 ` [PATCH 1/5] serial: sh-sci: Sort headers alphabetically Laurent Pinchart
2013-10-29 10:29   ` Laurent Pinchart
2013-10-29 10:29 ` [PATCH 2/5] serial: sh-sci: Remove baud rate calculation algorithm 5 Laurent Pinchart
2013-10-29 10:29   ` Laurent Pinchart
2013-10-29 10:29 ` [PATCH 3/5] serial: sh-sci: Simplify baud rate calculation algorithms Laurent Pinchart
2013-10-29 10:29   ` Laurent Pinchart
2013-10-29 10:48   ` Laurent Pinchart
2013-10-29 10:48     ` Laurent Pinchart
2013-10-29 10:29 ` [PATCH 4/5] serial: sh-sci: Add OF support Laurent Pinchart
2013-10-29 10:29   ` Laurent Pinchart
2013-11-01  9:47   ` Bastian Hecht [this message]
2013-11-01  9:47     ` Bastian Hecht
2013-11-04  0:58     ` Laurent Pinchart
2013-11-04  0:58       ` Laurent Pinchart
2013-11-06 15:26       ` Bastian Hecht
2013-11-06 15:26         ` Bastian Hecht
2013-10-29 10:29 ` [PATCH 5/5] serial: sh-sci: Add device tree bindings documentation Laurent Pinchart
2013-10-29 10:29   ` Laurent Pinchart
2013-10-31 14:42   ` Kumar Gala
2013-10-31 14:42     ` Kumar Gala
2013-10-31 14:55     ` Laurent Pinchart
2013-10-31 14:55       ` Laurent Pinchart
2013-10-31 15:00       ` Kumar Gala
2013-10-31 15:00         ` Kumar Gala
2013-11-03 17:09         ` Laurent Pinchart
2013-11-03 17:09           ` Laurent Pinchart
2013-10-31  5:21 ` [PATCH 0/5] Add OF support to the sh-sci serial port driver Simon Horman
2013-10-31  5:21   ` Simon Horman
2013-10-31 12:30   ` Laurent Pinchart
2013-10-31 12:30     ` Laurent Pinchart
2013-11-01  0:17     ` Simon Horman
2013-11-01  0:17       ` Simon Horman

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=CABYn4sxC02bX7XqN8yQ-gYgZEdaHAUohOjyL3pjGYXK9kd8WXg@mail.gmail.com \
    --to=hechtb@gmail.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.