<br><br>2013³â 8¿ù 19ÀÏ ¿ù¿äÀÏ¿¡ Kukjin Kim<<a href="mailto:kgene.kim@samsung.com">kgene.kim@samsung.com</a>>´ÔÀÌ ÀÛ¼º:<br>> On 08/13/13 14:12, Chanho Park wrote:<br>>><br>>> The exynos4 platform is only dt-based since 3.10, we should convert driver data<br>
>> and ids to dt-based parsing methods. The rotator driver has a limit table to get<br>>> size limit of input picture. Each SoCs has slightly different limit value<br>>> compared with any others.<br>>> For example, exynos4210's max_size of RGB888 is 16k x 16k. But, others have<br>
>> 8k x 8k. Another example the exynos5250 should have multiple of 2 pixel size<br>>> for its X/Y axis. Thus, we should keep different tables for each of them.<br>>> This patch also includes desciptions of each nodes for the rotator and specifies<br>
>> a example how to bind it.<br>>><br>>> Signed-off-by: Chanho Park<<a href="mailto:chanho61.park@samsung.com">chanho61.park@samsung.com</a>><br>>> Cc: Inki Dae<<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>><br>
><br>> Inki, do you OK on this? If so, let me take this whole series into the samsung tree.<br><br>Signed-off-by: Inki Dae <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>><br><br>Thanks,<br>Inki Dae<br>
<br>><br>> Thanks,<br>> Kukjin<br>><br>>> Signed-off-by: Kyungmin Park<<a href="mailto:kyungmin.park@samsung.com">kyungmin.park@samsung.com</a>><br>>> ---<br>>>   .../devicetree/bindings/gpu/samsung-rotator.txt    |   27 +++++<br>
>>   drivers/gpu/drm/exynos/exynos_drm_rotator.c        |  108 +++++++++++++++-----<br>>>   2 files changed, 107 insertions(+), 28 deletions(-)<br>>>   create mode 100644 Documentation/devicetree/bindings/gpu/samsung-rotator.txt<br>
>><br>>> diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt<br>>> new file mode 100644<br>>> index 0000000..82cd1ed<br>
>> --- /dev/null<br>>> +++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt<br>>> @@ -0,0 +1,27 @@<br>>> +* Samsung Image Rotator<br>>> +<br>>> +Required properties:<br>>> +  - compatible : value should be one of the following:<br>
>> +       (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210<br>>> +       (b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412<br>>> +       (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250<br>
>> +<br>>> +  - reg : Physical base address of the IP registers and length of memory<br>>> +         mapped region.<br>>> +<br>>> +  - interrupts : Interrupt specifier for rotator interrupt, according to format<br>
>> +                specific to interrupt parent.<br>>> +<br>>> +  - clocks : Clock specifier for rotator clock, according to generic clock<br>>> +            bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt)<br>
>> +<br>>> +  - clock-names : Names of clocks. For exynos rotator, it should be "rotator".<br>>> +<br>>> +Example:<br>>> +       rotator@12810000 {<br>>> +               compatible = "samsung,exynos4210-rotator";<br>
>> +               reg =<0x12810000 0x1000>;<br>>> +               interrupts =<0 83 0>;<br>>> +               clocks =<&clock 278>;<br>>> +               clock-names = "rotator";<br>
>> +       };<br>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c<br>>> index 427640a..0485aea5 100644<br>>> --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c<br>
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c<br>>> @@ -632,21 +632,98 @@ static int rotator_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)<br>>>         return 0;<br>>>   }<br>
>><br>>> +static struct rot_limit_table rot_limit_tbl_4210 = {<br>>> +       .ycbcr420_2p = {<br>>> +               .min_w = 32,<br>>> +               .min_h = 32,<br>>> +               .max_w = SZ_64K,<br>
>> +               .max_h = SZ_64K,<br>>> +               .align = 3,<br>>> +       },<br>>> +       .rgb888 = {<br>>> +               .min_w = 8,<br>>> +               .min_h = 8,<br>>> +               .max_w = SZ_16K,<br>
>> +               .max_h = SZ_16K,<br>>> +               .align = 2,<br>>> +       },<br>>> +};<br>>> +<br>>> +static struct rot_limit_table rot_limit_tbl_4x12 = {<br>>> +       .ycbcr420_2p = {<br>
>> +               .min_w = 32,<br>>> +               .min_h = 32,<br>>> +               .max_w = SZ_32K,<br>>> +               .max_h = SZ_32K,<br>>> +               .align = 3,<br>>> +       },<br>
>> +       .rgb888 = {<br>>> +               .min_w = 8,<br>>> +               .min_h = 8,<br>>> +               .max_w = SZ_8K,<br>>> +               .max_h = SZ_8K,<br>>> +               .align = 2,<br>
>> +       },<br>>> +};<br>>> +<br>>> +static struct rot_limit_table rot_limit_tbl_5250 = {<br>>> +       .ycbcr420_2p = {<br>>> +               .min_w = 32,<br>>> +               .min_h = 32,<br>
>> +               .max_w = SZ_32K,<br>>> +               .max_h = SZ_32K,<br>>> +               .align = 3,<br>>> +       },<br>>> +       .rgb888 = {<br>>> +               .min_w = 8,<br>
>> +               .min_h = 8,<br>>> +               .max_w = SZ_8K,<br>>> +               .max_h = SZ_8K,<br>>> +               .align = 1,<br>>> +       },<br>>> +};<br>>> +<br>
>> +static const struct of_device_id exynos_rotator_match[] = {<br>>> +       {<br>>> +               .compatible = "samsung,exynos4210-rotator",<br>>> +               .data =&rot_limit_tbl_4210,<br>
>> +       },<br>>> +       {<br>>> +               .compatible = "samsung,exynos4212-rotator",<br>>> +               .data =&rot_limit_tbl_4x12,<br>>> +       },<br>>> +       {<br>
>> +               .compatible = "samsung,exynos5250-rotator",<br>>> +               .data =&rot_limit_tbl_5250,<br>>> +       },<br>>> +       {},<br>>> +};<br>>> +<br>>>   static int rotator_probe(struct platform_device *pdev)<br>
>>   {<br>>>         struct device *dev =&pdev->dev;<br>>>         struct rot_context *rot;<br>>>         struct exynos_drm_ippdrv *ippdrv;<br>>> +       const struct of_device_id *match;<br>
>>         int ret;<br>>><br>>> +       if (!dev->of_node) {<br>>> +               dev_err(dev, "cannot find of_node.\n");<br>>> +               return -ENODEV;<br>>> +       }<br>
>> +<br>>>         rot = devm_kzalloc(dev, sizeof(*rot), GFP_KERNEL);<br>>>         if (!rot) {<br>>>                 dev_err(dev, "failed to allocate rot\n");<br>>>                 return -ENOMEM;<br>
>>         }<br>>><br>>> -       rot->limit_tbl = (struct rot_limit_table *)<br>>> -                               platform_get_device_id(pdev)->driver_data;<br>>> +       match = of_match_node(exynos_rotator_match, dev->of_node);<br>
>> +       if (!match) {<br>>> +               dev_err(dev, "failed to match node\n");<br>>> +               return -ENODEV;<br>>> +       }<br>>> +       rot->limit_tbl = (struct rot_limit_table *)match->data;<br>
>><br>>>         rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);<br>>>         rot->regs = devm_ioremap_resource(dev, rot->regs_res);<br>>> @@ -718,31 +795,6 @@ static int rotator_remove(struct platform_device *pdev)<br>
>>         return 0;<br>>>   }<br>>><br>>> -static struct rot_limit_table rot_limit_tbl = {<br>>> -       .ycbcr420_2p = {<br>>> -               .min_w = 32,<br>>> -               .min_h = 32,<br>
>> -               .max_w = SZ_32K,<br>>> -               .max_h = SZ_32K,<br>>> -               .align = 3,<br>>> -       },<br>>> -       .rgb888 = {<br>>> -               .min_w = 8,<br>
>> -               .min_h = 8,<br>>> -               .max_w = SZ_8K,<br>>> -               .max_h = SZ_8K,<br>>> -               .align = 2,<br>>> -       },<br>>> -};<br>>> -<br>
>> -static struct platform_device_id rotator_driver_ids[] = {<br>>> -       {<br>>> -               .name           = "exynos-rot",<br>>> -               .driver_data    = (unsigned long)&rot_limit_tbl,<br>
>> -       },<br>>> -       {},<br>>> -};<br>>> -<br>>>   static int rotator_clk_crtl(struct rot_context *rot, bool enable)<br>>>   {<br>>>         if (enable) {<br>>> @@ -804,10 +856,10 @@ static const struct dev_pm_ops rotator_pm_ops = {<br>
>>   struct platform_driver rotator_driver = {<br>>>         .probe          = rotator_probe,<br>>>         .remove         = rotator_remove,<br>>> -       .id_table       = rotator_driver_ids,<br>
>>         .driver         = {<br>>>                 .name   = "exynos-rot",<br>>>                 .owner  = THIS_MODULE,<br>>>                 .pm     =&rotator_pm_ops,<br>>> +               .of_match_table = exynos_rotator_match,<br>
>>         },<br>>>   };<br>><br>> --<br>> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in<br>> the body of a message to <a href="mailto:majordomo@vger.kernel.org">majordomo@vger.kernel.org</a><br>
> More majordomo info at  <a href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a><br>>