Re: [PATCH 4/5] serial: sh-sci: Add OF support

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux