* [PATCHv3 0/4] device tree support for exynos rotator
@ 2013-08-13 5:12 ` Chanho Park
0 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: inki.dae, kgene.kim
Cc: dri-devel, kyungmin.park, mark.rutland, l.stach, s.nawrocki,
tomasz.figa, linux-samsung-soc, sachin.kamat, linux-arm-kernel,
devicetree, Chanho Park
This patchset includes device tree support for rotator of exynos4210/4x12/5250.
Unfortunately, each of them has slightly different limitations of image size.
The rotator can support several image formats(RGB888/555, YCbCr422/420_2/3p).
For convinience, however, exynos drm rotator driver only support RGB888 and
YCbCr420 2-Plane formats. For example, the exynos4210 has 16k x 16k maximum size
. But rest of them has 8k x 8k. In addition, RGB888 X/Y pixel size of exynos5250
should be multiple of 2. But others are multiple of 4.
Thus, we should define different compatibles and limit tables for each chipsets.
This patchset is based on the Kukjin's dt-exynos tree.
(git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
v3.12-next/dt-exynos)
Changes from v2:
- Remove unnecessary 'of_match_ptr'
- Consolidate dt support code and documentation into one patch
- Fix typo and remove status node.
Changes from v1:
- Added exynos5250 binding.
- Move limit table into driver code from DT-nodes
Chanho Park (4):
drm/exynos: add device tree support for rotator
ARM: dts: Add rotator node for exynos4210
ARM: dts: Add rotator node for exynos4x12
ARM: dts: Add rotator node for exynos5250
.../devicetree/bindings/gpu/samsung-rotator.txt | 27 +++++
arch/arm/boot/dts/exynos4.dtsi | 8 ++
arch/arm/boot/dts/exynos4x12.dtsi | 4 +
arch/arm/boot/dts/exynos5250.dtsi | 8 ++
drivers/gpu/drm/exynos/exynos_drm_rotator.c | 108 +++++++++++++++-----
5 files changed, 127 insertions(+), 28 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpu/samsung-rotator.txt
--
1.7.9.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCHv3 0/4] device tree support for exynos rotator
@ 2013-08-13 5:12 ` Chanho Park
0 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: linux-arm-kernel
This patchset includes device tree support for rotator of exynos4210/4x12/5250.
Unfortunately, each of them has slightly different limitations of image size.
The rotator can support several image formats(RGB888/555, YCbCr422/420_2/3p).
For convinience, however, exynos drm rotator driver only support RGB888 and
YCbCr420 2-Plane formats. For example, the exynos4210 has 16k x 16k maximum size
. But rest of them has 8k x 8k. In addition, RGB888 X/Y pixel size of exynos5250
should be multiple of 2. But others are multiple of 4.
Thus, we should define different compatibles and limit tables for each chipsets.
This patchset is based on the Kukjin's dt-exynos tree.
(git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
v3.12-next/dt-exynos)
Changes from v2:
- Remove unnecessary 'of_match_ptr'
- Consolidate dt support code and documentation into one patch
- Fix typo and remove status node.
Changes from v1:
- Added exynos5250 binding.
- Move limit table into driver code from DT-nodes
Chanho Park (4):
drm/exynos: add device tree support for rotator
ARM: dts: Add rotator node for exynos4210
ARM: dts: Add rotator node for exynos4x12
ARM: dts: Add rotator node for exynos5250
.../devicetree/bindings/gpu/samsung-rotator.txt | 27 +++++
arch/arm/boot/dts/exynos4.dtsi | 8 ++
arch/arm/boot/dts/exynos4x12.dtsi | 4 +
arch/arm/boot/dts/exynos5250.dtsi | 8 ++
drivers/gpu/drm/exynos/exynos_drm_rotator.c | 108 +++++++++++++++-----
5 files changed, 127 insertions(+), 28 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpu/samsung-rotator.txt
--
1.7.9.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCHv3 1/4] drm/exynos: add device tree support for rotator
2013-08-13 5:12 ` Chanho Park
@ 2013-08-13 5:12 ` Chanho Park
-1 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: inki.dae, kgene.kim
Cc: dri-devel, kyungmin.park, mark.rutland, l.stach, s.nawrocki,
tomasz.figa, linux-samsung-soc, sachin.kamat, linux-arm-kernel,
devicetree, Chanho Park
The exynos4 platform is only dt-based since 3.10, we should convert driver data
and ids to dt-based parsing methods. The rotator driver has a limit table to get
size limit of input picture. Each SoCs has slightly different limit value
compared with any others.
For example, exynos4210's max_size of RGB888 is 16k x 16k. But, others have
8k x 8k. Another example the exynos5250 should have multiple of 2 pixel size
for its X/Y axis. Thus, we should keep different tables for each of them.
This patch also includes desciptions of each nodes for the rotator and specifies
a example how to bind it.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
.../devicetree/bindings/gpu/samsung-rotator.txt | 27 +++++
drivers/gpu/drm/exynos/exynos_drm_rotator.c | 108 +++++++++++++++-----
2 files changed, 107 insertions(+), 28 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpu/samsung-rotator.txt
diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
new file mode 100644
index 0000000..82cd1ed
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
@@ -0,0 +1,27 @@
+* Samsung Image Rotator
+
+Required properties:
+ - compatible : value should be one of the following:
+ (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
+ (b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
+ (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
+
+ - reg : Physical base address of the IP registers and length of memory
+ mapped region.
+
+ - interrupts : Interrupt specifier for rotator interrupt, according to format
+ specific to interrupt parent.
+
+ - clocks : Clock specifier for rotator clock, according to generic clock
+ bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt)
+
+ - clock-names : Names of clocks. For exynos rotator, it should be "rotator".
+
+Example:
+ rotator@12810000 {
+ compatible = "samsung,exynos4210-rotator";
+ reg = <0x12810000 0x1000>;
+ interrupts = <0 83 0>;
+ clocks = <&clock 278>;
+ clock-names = "rotator";
+ };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index 427640a..0485aea5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -632,21 +632,98 @@ static int rotator_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
return 0;
}
+static struct rot_limit_table rot_limit_tbl_4210 = {
+ .ycbcr420_2p = {
+ .min_w = 32,
+ .min_h = 32,
+ .max_w = SZ_64K,
+ .max_h = SZ_64K,
+ .align = 3,
+ },
+ .rgb888 = {
+ .min_w = 8,
+ .min_h = 8,
+ .max_w = SZ_16K,
+ .max_h = SZ_16K,
+ .align = 2,
+ },
+};
+
+static struct rot_limit_table rot_limit_tbl_4x12 = {
+ .ycbcr420_2p = {
+ .min_w = 32,
+ .min_h = 32,
+ .max_w = SZ_32K,
+ .max_h = SZ_32K,
+ .align = 3,
+ },
+ .rgb888 = {
+ .min_w = 8,
+ .min_h = 8,
+ .max_w = SZ_8K,
+ .max_h = SZ_8K,
+ .align = 2,
+ },
+};
+
+static struct rot_limit_table rot_limit_tbl_5250 = {
+ .ycbcr420_2p = {
+ .min_w = 32,
+ .min_h = 32,
+ .max_w = SZ_32K,
+ .max_h = SZ_32K,
+ .align = 3,
+ },
+ .rgb888 = {
+ .min_w = 8,
+ .min_h = 8,
+ .max_w = SZ_8K,
+ .max_h = SZ_8K,
+ .align = 1,
+ },
+};
+
+static const struct of_device_id exynos_rotator_match[] = {
+ {
+ .compatible = "samsung,exynos4210-rotator",
+ .data = &rot_limit_tbl_4210,
+ },
+ {
+ .compatible = "samsung,exynos4212-rotator",
+ .data = &rot_limit_tbl_4x12,
+ },
+ {
+ .compatible = "samsung,exynos5250-rotator",
+ .data = &rot_limit_tbl_5250,
+ },
+ {},
+};
+
static int rotator_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct rot_context *rot;
struct exynos_drm_ippdrv *ippdrv;
+ const struct of_device_id *match;
int ret;
+ if (!dev->of_node) {
+ dev_err(dev, "cannot find of_node.\n");
+ return -ENODEV;
+ }
+
rot = devm_kzalloc(dev, sizeof(*rot), GFP_KERNEL);
if (!rot) {
dev_err(dev, "failed to allocate rot\n");
return -ENOMEM;
}
- rot->limit_tbl = (struct rot_limit_table *)
- platform_get_device_id(pdev)->driver_data;
+ match = of_match_node(exynos_rotator_match, dev->of_node);
+ if (!match) {
+ dev_err(dev, "failed to match node\n");
+ return -ENODEV;
+ }
+ rot->limit_tbl = (struct rot_limit_table *)match->data;
rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rot->regs = devm_ioremap_resource(dev, rot->regs_res);
@@ -718,31 +795,6 @@ static int rotator_remove(struct platform_device *pdev)
return 0;
}
-static struct rot_limit_table rot_limit_tbl = {
- .ycbcr420_2p = {
- .min_w = 32,
- .min_h = 32,
- .max_w = SZ_32K,
- .max_h = SZ_32K,
- .align = 3,
- },
- .rgb888 = {
- .min_w = 8,
- .min_h = 8,
- .max_w = SZ_8K,
- .max_h = SZ_8K,
- .align = 2,
- },
-};
-
-static struct platform_device_id rotator_driver_ids[] = {
- {
- .name = "exynos-rot",
- .driver_data = (unsigned long)&rot_limit_tbl,
- },
- {},
-};
-
static int rotator_clk_crtl(struct rot_context *rot, bool enable)
{
if (enable) {
@@ -804,10 +856,10 @@ static const struct dev_pm_ops rotator_pm_ops = {
struct platform_driver rotator_driver = {
.probe = rotator_probe,
.remove = rotator_remove,
- .id_table = rotator_driver_ids,
.driver = {
.name = "exynos-rot",
.owner = THIS_MODULE,
.pm = &rotator_pm_ops,
+ .of_match_table = exynos_rotator_match,
},
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv3 1/4] drm/exynos: add device tree support for rotator
@ 2013-08-13 5:12 ` Chanho Park
0 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: linux-arm-kernel
The exynos4 platform is only dt-based since 3.10, we should convert driver data
and ids to dt-based parsing methods. The rotator driver has a limit table to get
size limit of input picture. Each SoCs has slightly different limit value
compared with any others.
For example, exynos4210's max_size of RGB888 is 16k x 16k. But, others have
8k x 8k. Another example the exynos5250 should have multiple of 2 pixel size
for its X/Y axis. Thus, we should keep different tables for each of them.
This patch also includes desciptions of each nodes for the rotator and specifies
a example how to bind it.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
.../devicetree/bindings/gpu/samsung-rotator.txt | 27 +++++
drivers/gpu/drm/exynos/exynos_drm_rotator.c | 108 +++++++++++++++-----
2 files changed, 107 insertions(+), 28 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpu/samsung-rotator.txt
diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
new file mode 100644
index 0000000..82cd1ed
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
@@ -0,0 +1,27 @@
+* Samsung Image Rotator
+
+Required properties:
+ - compatible : value should be one of the following:
+ (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
+ (b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
+ (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
+
+ - reg : Physical base address of the IP registers and length of memory
+ mapped region.
+
+ - interrupts : Interrupt specifier for rotator interrupt, according to format
+ specific to interrupt parent.
+
+ - clocks : Clock specifier for rotator clock, according to generic clock
+ bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt)
+
+ - clock-names : Names of clocks. For exynos rotator, it should be "rotator".
+
+Example:
+ rotator at 12810000 {
+ compatible = "samsung,exynos4210-rotator";
+ reg = <0x12810000 0x1000>;
+ interrupts = <0 83 0>;
+ clocks = <&clock 278>;
+ clock-names = "rotator";
+ };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index 427640a..0485aea5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -632,21 +632,98 @@ static int rotator_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
return 0;
}
+static struct rot_limit_table rot_limit_tbl_4210 = {
+ .ycbcr420_2p = {
+ .min_w = 32,
+ .min_h = 32,
+ .max_w = SZ_64K,
+ .max_h = SZ_64K,
+ .align = 3,
+ },
+ .rgb888 = {
+ .min_w = 8,
+ .min_h = 8,
+ .max_w = SZ_16K,
+ .max_h = SZ_16K,
+ .align = 2,
+ },
+};
+
+static struct rot_limit_table rot_limit_tbl_4x12 = {
+ .ycbcr420_2p = {
+ .min_w = 32,
+ .min_h = 32,
+ .max_w = SZ_32K,
+ .max_h = SZ_32K,
+ .align = 3,
+ },
+ .rgb888 = {
+ .min_w = 8,
+ .min_h = 8,
+ .max_w = SZ_8K,
+ .max_h = SZ_8K,
+ .align = 2,
+ },
+};
+
+static struct rot_limit_table rot_limit_tbl_5250 = {
+ .ycbcr420_2p = {
+ .min_w = 32,
+ .min_h = 32,
+ .max_w = SZ_32K,
+ .max_h = SZ_32K,
+ .align = 3,
+ },
+ .rgb888 = {
+ .min_w = 8,
+ .min_h = 8,
+ .max_w = SZ_8K,
+ .max_h = SZ_8K,
+ .align = 1,
+ },
+};
+
+static const struct of_device_id exynos_rotator_match[] = {
+ {
+ .compatible = "samsung,exynos4210-rotator",
+ .data = &rot_limit_tbl_4210,
+ },
+ {
+ .compatible = "samsung,exynos4212-rotator",
+ .data = &rot_limit_tbl_4x12,
+ },
+ {
+ .compatible = "samsung,exynos5250-rotator",
+ .data = &rot_limit_tbl_5250,
+ },
+ {},
+};
+
static int rotator_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct rot_context *rot;
struct exynos_drm_ippdrv *ippdrv;
+ const struct of_device_id *match;
int ret;
+ if (!dev->of_node) {
+ dev_err(dev, "cannot find of_node.\n");
+ return -ENODEV;
+ }
+
rot = devm_kzalloc(dev, sizeof(*rot), GFP_KERNEL);
if (!rot) {
dev_err(dev, "failed to allocate rot\n");
return -ENOMEM;
}
- rot->limit_tbl = (struct rot_limit_table *)
- platform_get_device_id(pdev)->driver_data;
+ match = of_match_node(exynos_rotator_match, dev->of_node);
+ if (!match) {
+ dev_err(dev, "failed to match node\n");
+ return -ENODEV;
+ }
+ rot->limit_tbl = (struct rot_limit_table *)match->data;
rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rot->regs = devm_ioremap_resource(dev, rot->regs_res);
@@ -718,31 +795,6 @@ static int rotator_remove(struct platform_device *pdev)
return 0;
}
-static struct rot_limit_table rot_limit_tbl = {
- .ycbcr420_2p = {
- .min_w = 32,
- .min_h = 32,
- .max_w = SZ_32K,
- .max_h = SZ_32K,
- .align = 3,
- },
- .rgb888 = {
- .min_w = 8,
- .min_h = 8,
- .max_w = SZ_8K,
- .max_h = SZ_8K,
- .align = 2,
- },
-};
-
-static struct platform_device_id rotator_driver_ids[] = {
- {
- .name = "exynos-rot",
- .driver_data = (unsigned long)&rot_limit_tbl,
- },
- {},
-};
-
static int rotator_clk_crtl(struct rot_context *rot, bool enable)
{
if (enable) {
@@ -804,10 +856,10 @@ static const struct dev_pm_ops rotator_pm_ops = {
struct platform_driver rotator_driver = {
.probe = rotator_probe,
.remove = rotator_remove,
- .id_table = rotator_driver_ids,
.driver = {
.name = "exynos-rot",
.owner = THIS_MODULE,
.pm = &rotator_pm_ops,
+ .of_match_table = exynos_rotator_match,
},
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv3 2/4] ARM: dts: Add rotator node for exynos4210
2013-08-13 5:12 ` Chanho Park
@ 2013-08-13 5:12 ` Chanho Park
-1 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: inki.dae, kgene.kim
Cc: dri-devel, kyungmin.park, mark.rutland, l.stach, s.nawrocki,
tomasz.figa, linux-samsung-soc, sachin.kamat, linux-arm-kernel,
devicetree, Chanho Park, Thomas Abraham
This patch adds a rotator node for exynos4210. The exynos4210 has different
limitation of image size compared with later chips.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 597cfcf..baa3e56 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -243,6 +243,14 @@
status = "disabled";
};
+ rotator@12810000 {
+ compatible = "samsung,exynos4210-rotator";
+ reg = <0x12810000 0x1000>;
+ interrupts = <0 83 0>;
+ clocks = <&clock 278>;
+ clock-names = "rotator";
+ };
+
mfc: codec@13400000 {
compatible = "samsung,mfc-v5";
reg = <0x13400000 0x10000>;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv3 2/4] ARM: dts: Add rotator node for exynos4210
@ 2013-08-13 5:12 ` Chanho Park
0 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds a rotator node for exynos4210. The exynos4210 has different
limitation of image size compared with later chips.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 597cfcf..baa3e56 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -243,6 +243,14 @@
status = "disabled";
};
+ rotator at 12810000 {
+ compatible = "samsung,exynos4210-rotator";
+ reg = <0x12810000 0x1000>;
+ interrupts = <0 83 0>;
+ clocks = <&clock 278>;
+ clock-names = "rotator";
+ };
+
mfc: codec at 13400000 {
compatible = "samsung,mfc-v5";
reg = <0x13400000 0x10000>;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv3 3/4] ARM: dts: Add rotator node for exynos4x12
2013-08-13 5:12 ` Chanho Park
@ 2013-08-13 5:12 ` Chanho Park
-1 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: inki.dae, kgene.kim
Cc: dri-devel, kyungmin.park, mark.rutland, l.stach, s.nawrocki,
tomasz.figa, linux-samsung-soc, sachin.kamat, linux-arm-kernel,
devicetree, Chanho Park, Thomas Abraham
This patch adds a rotator node for exynos4212 and 4412. These have different
limitation of image size compared with the exynos4210. So, we should define
new compatible to distinguish it from the exynos4210.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/boot/dts/exynos4x12.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index 954628c..280c56f 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -176,4 +176,8 @@
};
};
};
+
+ rotator@12810000 {
+ compatible = "samsung,exynos4212-rotator";
+ };
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv3 3/4] ARM: dts: Add rotator node for exynos4x12
@ 2013-08-13 5:12 ` Chanho Park
0 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds a rotator node for exynos4212 and 4412. These have different
limitation of image size compared with the exynos4210. So, we should define
new compatible to distinguish it from the exynos4210.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/boot/dts/exynos4x12.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index 954628c..280c56f 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -176,4 +176,8 @@
};
};
};
+
+ rotator at 12810000 {
+ compatible = "samsung,exynos4212-rotator";
+ };
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv3 4/4] ARM: dts: Add rotator node for exynos5250
2013-08-13 5:12 ` Chanho Park
@ 2013-08-13 5:12 ` Chanho Park
-1 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: inki.dae, kgene.kim
Cc: dri-devel, kyungmin.park, mark.rutland, l.stach, s.nawrocki,
tomasz.figa, linux-samsung-soc, sachin.kamat, linux-arm-kernel,
devicetree, Chanho Park, Thomas Abraham
This patch adds a rotator node for exynos5250. It has different align value of
image size compared with any other chips. So, we should define new compatible
for the exynos5250.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/boot/dts/exynos5250.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 6f356ce..f579546 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -570,6 +570,14 @@
};
};
+ rotator@11C00000 {
+ compatible = "samsung,exynos5250-rotator";
+ reg = <0x11C00000 0x1000>;
+ interrupts = <0 84 0>;
+ clocks = <&clock 269>;
+ clock-names = "rotator";
+ };
+
gsc_0: gsc@0x13e00000 {
compatible = "samsung,exynos5-gsc";
reg = <0x13e00000 0x1000>;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv3 4/4] ARM: dts: Add rotator node for exynos5250
@ 2013-08-13 5:12 ` Chanho Park
0 siblings, 0 replies; 13+ messages in thread
From: Chanho Park @ 2013-08-13 5:12 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds a rotator node for exynos5250. It has different align value of
image size compared with any other chips. So, we should define new compatible
for the exynos5250.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/boot/dts/exynos5250.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 6f356ce..f579546 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -570,6 +570,14 @@
};
};
+ rotator at 11C00000 {
+ compatible = "samsung,exynos5250-rotator";
+ reg = <0x11C00000 0x1000>;
+ interrupts = <0 84 0>;
+ clocks = <&clock 269>;
+ clock-names = "rotator";
+ };
+
gsc_0: gsc at 0x13e00000 {
compatible = "samsung,exynos5-gsc";
reg = <0x13e00000 0x1000>;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCHv3 1/4] drm/exynos: add device tree support for rotator
2013-08-13 5:12 ` Chanho Park
@ 2013-08-18 19:21 ` Kukjin Kim
-1 siblings, 0 replies; 13+ messages in thread
From: Kukjin Kim @ 2013-08-18 19:21 UTC (permalink / raw)
To: Chanho Park
Cc: inki.dae, kgene.kim, dri-devel, kyungmin.park, mark.rutland,
l.stach, s.nawrocki, tomasz.figa, linux-samsung-soc, sachin.kamat,
linux-arm-kernel, devicetree
On 08/13/13 14:12, Chanho Park wrote:
> The exynos4 platform is only dt-based since 3.10, we should convert driver data
> and ids to dt-based parsing methods. The rotator driver has a limit table to get
> size limit of input picture. Each SoCs has slightly different limit value
> compared with any others.
> For example, exynos4210's max_size of RGB888 is 16k x 16k. But, others have
> 8k x 8k. Another example the exynos5250 should have multiple of 2 pixel size
> for its X/Y axis. Thus, we should keep different tables for each of them.
> This patch also includes desciptions of each nodes for the rotator and specifies
> a example how to bind it.
>
> Signed-off-by: Chanho Park<chanho61.park@samsung.com>
> Cc: Inki Dae<inki.dae@samsung.com>
Inki, do you OK on this? If so, let me take this whole series into the
samsung tree.
Thanks,
Kukjin
> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
> ---
> .../devicetree/bindings/gpu/samsung-rotator.txt | 27 +++++
> drivers/gpu/drm/exynos/exynos_drm_rotator.c | 108 +++++++++++++++-----
> 2 files changed, 107 insertions(+), 28 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/gpu/samsung-rotator.txt
>
> diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
> new file mode 100644
> index 0000000..82cd1ed
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
> @@ -0,0 +1,27 @@
> +* Samsung Image Rotator
> +
> +Required properties:
> + - compatible : value should be one of the following:
> + (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
> + (b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
> + (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
> +
> + - reg : Physical base address of the IP registers and length of memory
> + mapped region.
> +
> + - interrupts : Interrupt specifier for rotator interrupt, according to format
> + specific to interrupt parent.
> +
> + - clocks : Clock specifier for rotator clock, according to generic clock
> + bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt)
> +
> + - clock-names : Names of clocks. For exynos rotator, it should be "rotator".
> +
> +Example:
> + rotator@12810000 {
> + compatible = "samsung,exynos4210-rotator";
> + reg =<0x12810000 0x1000>;
> + interrupts =<0 83 0>;
> + clocks =<&clock 278>;
> + clock-names = "rotator";
> + };
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> index 427640a..0485aea5 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> @@ -632,21 +632,98 @@ static int rotator_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
> return 0;
> }
>
> +static struct rot_limit_table rot_limit_tbl_4210 = {
> + .ycbcr420_2p = {
> + .min_w = 32,
> + .min_h = 32,
> + .max_w = SZ_64K,
> + .max_h = SZ_64K,
> + .align = 3,
> + },
> + .rgb888 = {
> + .min_w = 8,
> + .min_h = 8,
> + .max_w = SZ_16K,
> + .max_h = SZ_16K,
> + .align = 2,
> + },
> +};
> +
> +static struct rot_limit_table rot_limit_tbl_4x12 = {
> + .ycbcr420_2p = {
> + .min_w = 32,
> + .min_h = 32,
> + .max_w = SZ_32K,
> + .max_h = SZ_32K,
> + .align = 3,
> + },
> + .rgb888 = {
> + .min_w = 8,
> + .min_h = 8,
> + .max_w = SZ_8K,
> + .max_h = SZ_8K,
> + .align = 2,
> + },
> +};
> +
> +static struct rot_limit_table rot_limit_tbl_5250 = {
> + .ycbcr420_2p = {
> + .min_w = 32,
> + .min_h = 32,
> + .max_w = SZ_32K,
> + .max_h = SZ_32K,
> + .align = 3,
> + },
> + .rgb888 = {
> + .min_w = 8,
> + .min_h = 8,
> + .max_w = SZ_8K,
> + .max_h = SZ_8K,
> + .align = 1,
> + },
> +};
> +
> +static const struct of_device_id exynos_rotator_match[] = {
> + {
> + .compatible = "samsung,exynos4210-rotator",
> + .data =&rot_limit_tbl_4210,
> + },
> + {
> + .compatible = "samsung,exynos4212-rotator",
> + .data =&rot_limit_tbl_4x12,
> + },
> + {
> + .compatible = "samsung,exynos5250-rotator",
> + .data =&rot_limit_tbl_5250,
> + },
> + {},
> +};
> +
> static int rotator_probe(struct platform_device *pdev)
> {
> struct device *dev =&pdev->dev;
> struct rot_context *rot;
> struct exynos_drm_ippdrv *ippdrv;
> + const struct of_device_id *match;
> int ret;
>
> + if (!dev->of_node) {
> + dev_err(dev, "cannot find of_node.\n");
> + return -ENODEV;
> + }
> +
> rot = devm_kzalloc(dev, sizeof(*rot), GFP_KERNEL);
> if (!rot) {
> dev_err(dev, "failed to allocate rot\n");
> return -ENOMEM;
> }
>
> - rot->limit_tbl = (struct rot_limit_table *)
> - platform_get_device_id(pdev)->driver_data;
> + match = of_match_node(exynos_rotator_match, dev->of_node);
> + if (!match) {
> + dev_err(dev, "failed to match node\n");
> + return -ENODEV;
> + }
> + rot->limit_tbl = (struct rot_limit_table *)match->data;
>
> rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> rot->regs = devm_ioremap_resource(dev, rot->regs_res);
> @@ -718,31 +795,6 @@ static int rotator_remove(struct platform_device *pdev)
> return 0;
> }
>
> -static struct rot_limit_table rot_limit_tbl = {
> - .ycbcr420_2p = {
> - .min_w = 32,
> - .min_h = 32,
> - .max_w = SZ_32K,
> - .max_h = SZ_32K,
> - .align = 3,
> - },
> - .rgb888 = {
> - .min_w = 8,
> - .min_h = 8,
> - .max_w = SZ_8K,
> - .max_h = SZ_8K,
> - .align = 2,
> - },
> -};
> -
> -static struct platform_device_id rotator_driver_ids[] = {
> - {
> - .name = "exynos-rot",
> - .driver_data = (unsigned long)&rot_limit_tbl,
> - },
> - {},
> -};
> -
> static int rotator_clk_crtl(struct rot_context *rot, bool enable)
> {
> if (enable) {
> @@ -804,10 +856,10 @@ static const struct dev_pm_ops rotator_pm_ops = {
> struct platform_driver rotator_driver = {
> .probe = rotator_probe,
> .remove = rotator_remove,
> - .id_table = rotator_driver_ids,
> .driver = {
> .name = "exynos-rot",
> .owner = THIS_MODULE,
> .pm =&rotator_pm_ops,
> + .of_match_table = exynos_rotator_match,
> },
> };
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCHv3 1/4] drm/exynos: add device tree support for rotator
@ 2013-08-18 19:21 ` Kukjin Kim
0 siblings, 0 replies; 13+ messages in thread
From: Kukjin Kim @ 2013-08-18 19:21 UTC (permalink / raw)
To: linux-arm-kernel
On 08/13/13 14:12, Chanho Park wrote:
> The exynos4 platform is only dt-based since 3.10, we should convert driver data
> and ids to dt-based parsing methods. The rotator driver has a limit table to get
> size limit of input picture. Each SoCs has slightly different limit value
> compared with any others.
> For example, exynos4210's max_size of RGB888 is 16k x 16k. But, others have
> 8k x 8k. Another example the exynos5250 should have multiple of 2 pixel size
> for its X/Y axis. Thus, we should keep different tables for each of them.
> This patch also includes desciptions of each nodes for the rotator and specifies
> a example how to bind it.
>
> Signed-off-by: Chanho Park<chanho61.park@samsung.com>
> Cc: Inki Dae<inki.dae@samsung.com>
Inki, do you OK on this? If so, let me take this whole series into the
samsung tree.
Thanks,
Kukjin
> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
> ---
> .../devicetree/bindings/gpu/samsung-rotator.txt | 27 +++++
> drivers/gpu/drm/exynos/exynos_drm_rotator.c | 108 +++++++++++++++-----
> 2 files changed, 107 insertions(+), 28 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/gpu/samsung-rotator.txt
>
> diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
> new file mode 100644
> index 0000000..82cd1ed
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
> @@ -0,0 +1,27 @@
> +* Samsung Image Rotator
> +
> +Required properties:
> + - compatible : value should be one of the following:
> + (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
> + (b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
> + (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
> +
> + - reg : Physical base address of the IP registers and length of memory
> + mapped region.
> +
> + - interrupts : Interrupt specifier for rotator interrupt, according to format
> + specific to interrupt parent.
> +
> + - clocks : Clock specifier for rotator clock, according to generic clock
> + bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt)
> +
> + - clock-names : Names of clocks. For exynos rotator, it should be "rotator".
> +
> +Example:
> + rotator at 12810000 {
> + compatible = "samsung,exynos4210-rotator";
> + reg =<0x12810000 0x1000>;
> + interrupts =<0 83 0>;
> + clocks =<&clock 278>;
> + clock-names = "rotator";
> + };
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> index 427640a..0485aea5 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> @@ -632,21 +632,98 @@ static int rotator_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
> return 0;
> }
>
> +static struct rot_limit_table rot_limit_tbl_4210 = {
> + .ycbcr420_2p = {
> + .min_w = 32,
> + .min_h = 32,
> + .max_w = SZ_64K,
> + .max_h = SZ_64K,
> + .align = 3,
> + },
> + .rgb888 = {
> + .min_w = 8,
> + .min_h = 8,
> + .max_w = SZ_16K,
> + .max_h = SZ_16K,
> + .align = 2,
> + },
> +};
> +
> +static struct rot_limit_table rot_limit_tbl_4x12 = {
> + .ycbcr420_2p = {
> + .min_w = 32,
> + .min_h = 32,
> + .max_w = SZ_32K,
> + .max_h = SZ_32K,
> + .align = 3,
> + },
> + .rgb888 = {
> + .min_w = 8,
> + .min_h = 8,
> + .max_w = SZ_8K,
> + .max_h = SZ_8K,
> + .align = 2,
> + },
> +};
> +
> +static struct rot_limit_table rot_limit_tbl_5250 = {
> + .ycbcr420_2p = {
> + .min_w = 32,
> + .min_h = 32,
> + .max_w = SZ_32K,
> + .max_h = SZ_32K,
> + .align = 3,
> + },
> + .rgb888 = {
> + .min_w = 8,
> + .min_h = 8,
> + .max_w = SZ_8K,
> + .max_h = SZ_8K,
> + .align = 1,
> + },
> +};
> +
> +static const struct of_device_id exynos_rotator_match[] = {
> + {
> + .compatible = "samsung,exynos4210-rotator",
> + .data =&rot_limit_tbl_4210,
> + },
> + {
> + .compatible = "samsung,exynos4212-rotator",
> + .data =&rot_limit_tbl_4x12,
> + },
> + {
> + .compatible = "samsung,exynos5250-rotator",
> + .data =&rot_limit_tbl_5250,
> + },
> + {},
> +};
> +
> static int rotator_probe(struct platform_device *pdev)
> {
> struct device *dev =&pdev->dev;
> struct rot_context *rot;
> struct exynos_drm_ippdrv *ippdrv;
> + const struct of_device_id *match;
> int ret;
>
> + if (!dev->of_node) {
> + dev_err(dev, "cannot find of_node.\n");
> + return -ENODEV;
> + }
> +
> rot = devm_kzalloc(dev, sizeof(*rot), GFP_KERNEL);
> if (!rot) {
> dev_err(dev, "failed to allocate rot\n");
> return -ENOMEM;
> }
>
> - rot->limit_tbl = (struct rot_limit_table *)
> - platform_get_device_id(pdev)->driver_data;
> + match = of_match_node(exynos_rotator_match, dev->of_node);
> + if (!match) {
> + dev_err(dev, "failed to match node\n");
> + return -ENODEV;
> + }
> + rot->limit_tbl = (struct rot_limit_table *)match->data;
>
> rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> rot->regs = devm_ioremap_resource(dev, rot->regs_res);
> @@ -718,31 +795,6 @@ static int rotator_remove(struct platform_device *pdev)
> return 0;
> }
>
> -static struct rot_limit_table rot_limit_tbl = {
> - .ycbcr420_2p = {
> - .min_w = 32,
> - .min_h = 32,
> - .max_w = SZ_32K,
> - .max_h = SZ_32K,
> - .align = 3,
> - },
> - .rgb888 = {
> - .min_w = 8,
> - .min_h = 8,
> - .max_w = SZ_8K,
> - .max_h = SZ_8K,
> - .align = 2,
> - },
> -};
> -
> -static struct platform_device_id rotator_driver_ids[] = {
> - {
> - .name = "exynos-rot",
> - .driver_data = (unsigned long)&rot_limit_tbl,
> - },
> - {},
> -};
> -
> static int rotator_clk_crtl(struct rot_context *rot, bool enable)
> {
> if (enable) {
> @@ -804,10 +856,10 @@ static const struct dev_pm_ops rotator_pm_ops = {
> struct platform_driver rotator_driver = {
> .probe = rotator_probe,
> .remove = rotator_remove,
> - .id_table = rotator_driver_ids,
> .driver = {
> .name = "exynos-rot",
> .owner = THIS_MODULE,
> .pm =&rotator_pm_ops,
> + .of_match_table = exynos_rotator_match,
> },
> };
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCHv3 1/4] drm/exynos: add device tree support for rotator
2013-08-18 19:21 ` Kukjin Kim
(?)
@ 2013-08-19 2:03 ` Inki Dae
-1 siblings, 0 replies; 13+ messages in thread
From: Inki Dae @ 2013-08-19 2:03 UTC (permalink / raw)
To: Kukjin Kim
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, sachin.kamat@linaro.org,
dri-devel@lists.freedesktop.org, kyungmin.park@samsung.com,
s.nawrocki@samsung.com, Chanho Park,
linux-arm-kernel@lists.infradead.org
[-- Attachment #1.1: Type: text/plain, Size: 8116 bytes --]
2013년 8월 19일 월요일에 Kukjin Kim<kgene.kim@samsung.com>님이 작성:
> On 08/13/13 14:12, Chanho Park wrote:
>>
>> The exynos4 platform is only dt-based since 3.10, we should convert
driver data
>> and ids to dt-based parsing methods. The rotator driver has a limit
table to get
>> size limit of input picture. Each SoCs has slightly different limit value
>> compared with any others.
>> For example, exynos4210's max_size of RGB888 is 16k x 16k. But, others
have
>> 8k x 8k. Another example the exynos5250 should have multiple of 2 pixel
size
>> for its X/Y axis. Thus, we should keep different tables for each of them.
>> This patch also includes desciptions of each nodes for the rotator and
specifies
>> a example how to bind it.
>>
>> Signed-off-by: Chanho Park<chanho61.park@samsung.com>
>> Cc: Inki Dae<inki.dae@samsung.com>
>
> Inki, do you OK on this? If so, let me take this whole series into the
samsung tree.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Thanks,
Inki Dae
>
> Thanks,
> Kukjin
>
>> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>> ---
>> .../devicetree/bindings/gpu/samsung-rotator.txt | 27 +++++
>> drivers/gpu/drm/exynos/exynos_drm_rotator.c | 108
+++++++++++++++-----
>> 2 files changed, 107 insertions(+), 28 deletions(-)
>> create mode 100644
Documentation/devicetree/bindings/gpu/samsung-rotator.txt
>>
>> diff --git a/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
>> new file mode 100644
>> index 0000000..82cd1ed
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/gpu/samsung-rotator.txt
>> @@ -0,0 +1,27 @@
>> +* Samsung Image Rotator
>> +
>> +Required properties:
>> + - compatible : value should be one of the following:
>> + (a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
>> + (b) "samsung,exynos4212-rotator" for Rotator IP in
Exynos4212/4412
>> + (c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
>> +
>> + - reg : Physical base address of the IP registers and length of memory
>> + mapped region.
>> +
>> + - interrupts : Interrupt specifier for rotator interrupt, according
to format
>> + specific to interrupt parent.
>> +
>> + - clocks : Clock specifier for rotator clock, according to generic
clock
>> + bindings. (See
Documentation/devicetree/bindings/clock/exynos*.txt)
>> +
>> + - clock-names : Names of clocks. For exynos rotator, it should be
"rotator".
>> +
>> +Example:
>> + rotator@12810000 {
>> + compatible = "samsung,exynos4210-rotator";
>> + reg =<0x12810000 0x1000>;
>> + interrupts =<0 83 0>;
>> + clocks =<&clock 278>;
>> + clock-names = "rotator";
>> + };
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
>> index 427640a..0485aea5 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
>> @@ -632,21 +632,98 @@ static int rotator_ippdrv_start(struct device
*dev, enum drm_exynos_ipp_cmd cmd)
>> return 0;
>> }
>>
>> +static struct rot_limit_table rot_limit_tbl_4210 = {
>> + .ycbcr420_2p = {
>> + .min_w = 32,
>> + .min_h = 32,
>> + .max_w = SZ_64K,
>> + .max_h = SZ_64K,
>> + .align = 3,
>> + },
>> + .rgb888 = {
>> + .min_w = 8,
>> + .min_h = 8,
>> + .max_w = SZ_16K,
>> + .max_h = SZ_16K,
>> + .align = 2,
>> + },
>> +};
>> +
>> +static struct rot_limit_table rot_limit_tbl_4x12 = {
>> + .ycbcr420_2p = {
>> + .min_w = 32,
>> + .min_h = 32,
>> + .max_w = SZ_32K,
>> + .max_h = SZ_32K,
>> + .align = 3,
>> + },
>> + .rgb888 = {
>> + .min_w = 8,
>> + .min_h = 8,
>> + .max_w = SZ_8K,
>> + .max_h = SZ_8K,
>> + .align = 2,
>> + },
>> +};
>> +
>> +static struct rot_limit_table rot_limit_tbl_5250 = {
>> + .ycbcr420_2p = {
>> + .min_w = 32,
>> + .min_h = 32,
>> + .max_w = SZ_32K,
>> + .max_h = SZ_32K,
>> + .align = 3,
>> + },
>> + .rgb888 = {
>> + .min_w = 8,
>> + .min_h = 8,
>> + .max_w = SZ_8K,
>> + .max_h = SZ_8K,
>> + .align = 1,
>> + },
>> +};
>> +
>> +static const struct of_device_id exynos_rotator_match[] = {
>> + {
>> + .compatible = "samsung,exynos4210-rotator",
>> + .data =&rot_limit_tbl_4210,
>> + },
>> + {
>> + .compatible = "samsung,exynos4212-rotator",
>> + .data =&rot_limit_tbl_4x12,
>> + },
>> + {
>> + .compatible = "samsung,exynos5250-rotator",
>> + .data =&rot_limit_tbl_5250,
>> + },
>> + {},
>> +};
>> +
>> static int rotator_probe(struct platform_device *pdev)
>> {
>> struct device *dev =&pdev->dev;
>> struct rot_context *rot;
>> struct exynos_drm_ippdrv *ippdrv;
>> + const struct of_device_id *match;
>> int ret;
>>
>> + if (!dev->of_node) {
>> + dev_err(dev, "cannot find of_node.\n");
>> + return -ENODEV;
>> + }
>> +
>> rot = devm_kzalloc(dev, sizeof(*rot), GFP_KERNEL);
>> if (!rot) {
>> dev_err(dev, "failed to allocate rot\n");
>> return -ENOMEM;
>> }
>>
>> - rot->limit_tbl = (struct rot_limit_table *)
>> -
platform_get_device_id(pdev)->driver_data;
>> + match = of_match_node(exynos_rotator_match, dev->of_node);
>> + if (!match) {
>> + dev_err(dev, "failed to match node\n");
>> + return -ENODEV;
>> + }
>> + rot->limit_tbl = (struct rot_limit_table *)match->data;
>>
>> rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> rot->regs = devm_ioremap_resource(dev, rot->regs_res);
>> @@ -718,31 +795,6 @@ static int rotator_remove(struct platform_device
*pdev)
>> return 0;
>> }
>>
>> -static struct rot_limit_table rot_limit_tbl = {
>> - .ycbcr420_2p = {
>> - .min_w = 32,
>> - .min_h = 32,
>> - .max_w = SZ_32K,
>> - .max_h = SZ_32K,
>> - .align = 3,
>> - },
>> - .rgb888 = {
>> - .min_w = 8,
>> - .min_h = 8,
>> - .max_w = SZ_8K,
>> - .max_h = SZ_8K,
>> - .align = 2,
>> - },
>> -};
>> -
>> -static struct platform_device_id rotator_driver_ids[] = {
>> - {
>> - .name = "exynos-rot",
>> - .driver_data = (unsigned long)&rot_limit_tbl,
>> - },
>> - {},
>> -};
>> -
>> static int rotator_clk_crtl(struct rot_context *rot, bool enable)
>> {
>> if (enable) {
>> @@ -804,10 +856,10 @@ static const struct dev_pm_ops rotator_pm_ops = {
>> struct platform_driver rotator_driver = {
>> .probe = rotator_probe,
>> .remove = rotator_remove,
>> - .id_table = rotator_driver_ids,
>> .driver = {
>> .name = "exynos-rot",
>> .owner = THIS_MODULE,
>> .pm =&rotator_pm_ops,
>> + .of_match_table = exynos_rotator_match,
>> },
>> };
>
> --
> To unsubscribe from this list: send the line "unsubscribe
linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
[-- Attachment #1.2: Type: text/html, Size: 14075 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2013-08-19 2:03 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 5:12 [PATCHv3 0/4] device tree support for exynos rotator Chanho Park
2013-08-13 5:12 ` Chanho Park
2013-08-13 5:12 ` [PATCHv3 1/4] drm/exynos: add device tree support for rotator Chanho Park
2013-08-13 5:12 ` Chanho Park
2013-08-18 19:21 ` Kukjin Kim
2013-08-18 19:21 ` Kukjin Kim
2013-08-19 2:03 ` Inki Dae
2013-08-13 5:12 ` [PATCHv3 2/4] ARM: dts: Add rotator node for exynos4210 Chanho Park
2013-08-13 5:12 ` Chanho Park
2013-08-13 5:12 ` [PATCHv3 3/4] ARM: dts: Add rotator node for exynos4x12 Chanho Park
2013-08-13 5:12 ` Chanho Park
2013-08-13 5:12 ` [PATCHv3 4/4] ARM: dts: Add rotator node for exynos5250 Chanho Park
2013-08-13 5:12 ` Chanho Park
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.