* [PATCH 0/3] Add support for the S6E3HA2 edge panel on TM2e board [not found] <CGME20170414051958epcas5p379f82e72e9239fdea0b99de88c4c39f1@epcas5p3.samsung.com> @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: dri-devel, devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel, javier, a.hajda, andi.shyti, Hoegeun Kwon The purpose of this patch is add support for S6E3HA2 edge AMOLED panel on the TM2e board. The panel has 1600x2560 resolution in 5.65" physical panel in the TM2e device. The S6E3HA2 edge panel(5.65") is simliar to the previous S6E3HA2 panel(5.7"), but resolution and some command message are different. So it can be distinguished as a compatiblitiy string. Best regards, Hoegeun Hoegeun Kwon (3): dt-bindings: Add support for samsung s6e3ha2 edge panel binding drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board arm64: dts: exynos: Add support for S6E3HA2 edge panel device on TM2e board .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++ arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts | 12 +++++ drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 62 +++++++++++++++++++--- 3 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt -- 1.9.1 ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 0/3] Add support for the S6E3HA2 edge panel on TM2e board @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: linux-arm-kernel The purpose of this patch is add support for S6E3HA2 edge AMOLED panel on the TM2e board. The panel has 1600x2560 resolution in 5.65" physical panel in the TM2e device. The S6E3HA2 edge panel(5.65") is simliar to the previous S6E3HA2 panel(5.7"), but resolution and some command message are different. So it can be distinguished as a compatiblitiy string. Best regards, Hoegeun Hoegeun Kwon (3): dt-bindings: Add support for samsung s6e3ha2 edge panel binding drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board arm64: dts: exynos: Add support for S6E3HA2 edge panel device on TM2e board .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++ arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts | 12 +++++ drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 62 +++++++++++++++++++--- 3 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt -- 1.9.1 ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <CGME20170414051959epcas5p3917fe7adbc17a42bf0450a46b2baf55d@epcas5p3.samsung.com>]
* [PATCH 1/3] dt-bindings: Add support for samsung s6e3ha2 edge panel binding [not found] ` <CGME20170414051959epcas5p3917fe7adbc17a42bf0450a46b2baf55d@epcas5p3.samsung.com> 2017-04-14 5:19 ` Hoegeun Kwon @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: dri-devel, devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel, javier, a.hajda, andi.shyti, Hoegeun Kwon The Samsung s6e3ha2 edge is a 5.65" 1600x2560 AMOLED panel connected using MIPI-DSI interfaces. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt new file mode 100644 index 0000000..09c65f6 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt @@ -0,0 +1,28 @@ +Samsung S6E3HA2 5.65" 1600x2560 AMOLED panel + +Required properties: + - compatible: "samsung,s6e3ha2-e" + - reg: the virtual channel number of a DSI peripheral + - vdd3-supply: I/O voltage supply + - vci-supply: voltage supply for analog circuits + - reset-gpios: a GPIO spec for the reset pin (active low) + - enable-gpios: a GPIO spec for the panel enable pin (active high) + +Optional properties: + - te-gpios: a GPIO spec for the tearing effect synchronization signal + gpio pin (active high) + +Example: +&dsi { + ... + + panel@0 { + compatible = "samsung,s6e3ha2-e"; + reg = <0>; + vdd3-supply = <&ldo27_reg>; + vci-supply = <&ldo28_reg>; + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; + }; +}; -- 1.9.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 1/3] dt-bindings: Add support for samsung s6e3ha2 edge panel binding @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: linux-arm-kernel The Samsung s6e3ha2 edge is a 5.65" 1600x2560 AMOLED panel connected using MIPI-DSI interfaces. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt new file mode 100644 index 0000000..09c65f6 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt @@ -0,0 +1,28 @@ +Samsung S6E3HA2 5.65" 1600x2560 AMOLED panel + +Required properties: + - compatible: "samsung,s6e3ha2-e" + - reg: the virtual channel number of a DSI peripheral + - vdd3-supply: I/O voltage supply + - vci-supply: voltage supply for analog circuits + - reset-gpios: a GPIO spec for the reset pin (active low) + - enable-gpios: a GPIO spec for the panel enable pin (active high) + +Optional properties: + - te-gpios: a GPIO spec for the tearing effect synchronization signal + gpio pin (active high) + +Example: +&dsi { + ... + + panel at 0 { + compatible = "samsung,s6e3ha2-e"; + reg = <0>; + vdd3-supply = <&ldo27_reg>; + vci-supply = <&ldo28_reg>; + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; + }; +}; -- 1.9.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 1/3] dt-bindings: Add support for samsung s6e3ha2 edge panel binding @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: devicetree, linux-samsung-soc, linux-kernel, dri-devel, javier, andi.shyti, Hoegeun Kwon, linux-arm-kernel The Samsung s6e3ha2 edge is a 5.65" 1600x2560 AMOLED panel connected using MIPI-DSI interfaces. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt new file mode 100644 index 0000000..09c65f6 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt @@ -0,0 +1,28 @@ +Samsung S6E3HA2 5.65" 1600x2560 AMOLED panel + +Required properties: + - compatible: "samsung,s6e3ha2-e" + - reg: the virtual channel number of a DSI peripheral + - vdd3-supply: I/O voltage supply + - vci-supply: voltage supply for analog circuits + - reset-gpios: a GPIO spec for the reset pin (active low) + - enable-gpios: a GPIO spec for the panel enable pin (active high) + +Optional properties: + - te-gpios: a GPIO spec for the tearing effect synchronization signal + gpio pin (active high) + +Example: +&dsi { + ... + + panel@0 { + compatible = "samsung,s6e3ha2-e"; + reg = <0>; + vdd3-supply = <&ldo27_reg>; + vci-supply = <&ldo28_reg>; + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; + }; +}; -- 1.9.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 1/3] dt-bindings: Add support for samsung s6e3ha2 edge panel binding 2017-04-14 5:19 ` Hoegeun Kwon (?) @ 2017-04-14 7:33 ` Andrzej Hajda -1 siblings, 0 replies; 18+ messages in thread From: Andrzej Hajda @ 2017-04-14 7:33 UTC (permalink / raw) To: Hoegeun Kwon, thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: dri-devel, devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel, javier, andi.shyti Hi Hoegeun, On 14.04.2017 07:19, Hoegeun Kwon wrote: > The Samsung s6e3ha2 edge is a 5.65" 1600x2560 AMOLED panel connected > using MIPI-DSI interfaces. As I wrote in discussion about s6e3ha2, there is no edge version of s6e3ha2, it is just different panel: s6e3hf2, or more precisely IC driver. [1]: https://lkml.org/lkml/2017/1/9/159 > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > > diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > new file mode 100644 > index 0000000..09c65f6 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > @@ -0,0 +1,28 @@ > +Samsung S6E3HA2 5.65" 1600x2560 AMOLED panel > + > +Required properties: > + - compatible: "samsung,s6e3ha2-e" I think "samsung,s6e3hf2" should be then used, I guess it could be even simpler to just add new compatible string to samsung,s6e3ha2.txt binding with some comments, as these panels are of the same family. Regards Andrzej > + - reg: the virtual channel number of a DSI peripheral > + - vdd3-supply: I/O voltage supply > + - vci-supply: voltage supply for analog circuits > + - reset-gpios: a GPIO spec for the reset pin (active low) > + - enable-gpios: a GPIO spec for the panel enable pin (active high) > + > +Optional properties: > + - te-gpios: a GPIO spec for the tearing effect synchronization signal > + gpio pin (active high) > + > +Example: > +&dsi { > + ... > + > + panel@0 { > + compatible = "samsung,s6e3ha2-e"; > + reg = <0>; > + vdd3-supply = <&ldo27_reg>; > + vci-supply = <&ldo28_reg>; > + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; > + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; > + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; > + }; > +}; ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/3] dt-bindings: Add support for samsung s6e3ha2 edge panel binding @ 2017-04-14 7:33 ` Andrzej Hajda 0 siblings, 0 replies; 18+ messages in thread From: Andrzej Hajda @ 2017-04-14 7:33 UTC (permalink / raw) To: linux-arm-kernel Hi Hoegeun, On 14.04.2017 07:19, Hoegeun Kwon wrote: > The Samsung s6e3ha2 edge is a 5.65" 1600x2560 AMOLED panel connected > using MIPI-DSI interfaces. As I wrote in discussion about s6e3ha2, there is no edge version of s6e3ha2, it is just different panel: s6e3hf2, or more precisely IC driver. [1]: https://lkml.org/lkml/2017/1/9/159 > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > > diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > new file mode 100644 > index 0000000..09c65f6 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > @@ -0,0 +1,28 @@ > +Samsung S6E3HA2 5.65" 1600x2560 AMOLED panel > + > +Required properties: > + - compatible: "samsung,s6e3ha2-e" I think "samsung,s6e3hf2" should be then used, I guess it could be even simpler to just add new compatible string to samsung,s6e3ha2.txt binding with some comments, as these panels are of the same family. Regards Andrzej > + - reg: the virtual channel number of a DSI peripheral > + - vdd3-supply: I/O voltage supply > + - vci-supply: voltage supply for analog circuits > + - reset-gpios: a GPIO spec for the reset pin (active low) > + - enable-gpios: a GPIO spec for the panel enable pin (active high) > + > +Optional properties: > + - te-gpios: a GPIO spec for the tearing effect synchronization signal > + gpio pin (active high) > + > +Example: > +&dsi { > + ... > + > + panel at 0 { > + compatible = "samsung,s6e3ha2-e"; > + reg = <0>; > + vdd3-supply = <&ldo27_reg>; > + vci-supply = <&ldo28_reg>; > + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; > + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; > + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; > + }; > +}; ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/3] dt-bindings: Add support for samsung s6e3ha2 edge panel binding @ 2017-04-14 7:33 ` Andrzej Hajda 0 siblings, 0 replies; 18+ messages in thread From: Andrzej Hajda @ 2017-04-14 7:33 UTC (permalink / raw) To: Hoegeun Kwon, thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: devicetree, linux-samsung-soc, linux-kernel, dri-devel, javier, andi.shyti, linux-arm-kernel Hi Hoegeun, On 14.04.2017 07:19, Hoegeun Kwon wrote: > The Samsung s6e3ha2 edge is a 5.65" 1600x2560 AMOLED panel connected > using MIPI-DSI interfaces. As I wrote in discussion about s6e3ha2, there is no edge version of s6e3ha2, it is just different panel: s6e3hf2, or more precisely IC driver. [1]: https://lkml.org/lkml/2017/1/9/159 > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > .../bindings/display/panel/samsung,s6e3ha2-e.txt | 28 ++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > > diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > new file mode 100644 > index 0000000..09c65f6 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2-e.txt > @@ -0,0 +1,28 @@ > +Samsung S6E3HA2 5.65" 1600x2560 AMOLED panel > + > +Required properties: > + - compatible: "samsung,s6e3ha2-e" I think "samsung,s6e3hf2" should be then used, I guess it could be even simpler to just add new compatible string to samsung,s6e3ha2.txt binding with some comments, as these panels are of the same family. Regards Andrzej > + - reg: the virtual channel number of a DSI peripheral > + - vdd3-supply: I/O voltage supply > + - vci-supply: voltage supply for analog circuits > + - reset-gpios: a GPIO spec for the reset pin (active low) > + - enable-gpios: a GPIO spec for the panel enable pin (active high) > + > +Optional properties: > + - te-gpios: a GPIO spec for the tearing effect synchronization signal > + gpio pin (active high) > + > +Example: > +&dsi { > + ... > + > + panel@0 { > + compatible = "samsung,s6e3ha2-e"; > + reg = <0>; > + vdd3-supply = <&ldo27_reg>; > + vci-supply = <&ldo28_reg>; > + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; > + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; > + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; > + }; > +}; _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <CGME20170414051959epcas5p338f72abbf841233f6f1f0a240df2a1e9@epcas5p3.samsung.com>]
* [PATCH 2/3] drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board [not found] ` <CGME20170414051959epcas5p338f72abbf841233f6f1f0a240df2a1e9@epcas5p3.samsung.com> @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: dri-devel, devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel, javier, a.hajda, andi.shyti, Hoegeun Kwon This patch considers edge type of panel on TM2e board and The panel has 1600x2560 resolution in 5.65" physical panel in the TM2e device. This identify panel type with compatibility string, also invoke display mode that matches the type. So add the check code for default compatibility and edge type and select the drm_display_mode of default and edge type. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 62 ++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c index 4cc08d7..b4a064a 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -16,6 +16,7 @@ #include <drm/drm_panel.h> #include <linux/backlight.h> #include <linux/gpio/consumer.h> +#include <linux/of_device.h> #include <linux/regulator/consumer.h> #define S6E3HA2_MIN_BRIGHTNESS 0 @@ -218,6 +219,16 @@ 0x1d, 0x1e, 0x1f, 0x20, 0x21 }; +enum s6e3ha2_type { + DEFAULT_TYPE, + EDGE_TYPE, +}; + +struct s6e3ha2_panel_desc { + const struct drm_display_mode *mode; + enum s6e3ha2_type type; +}; + struct s6e3ha2 { struct device *dev; struct drm_panel panel; @@ -226,6 +237,8 @@ struct s6e3ha2 { struct regulator_bulk_data supplies[2]; struct gpio_desc *reset_gpio; struct gpio_desc *enable_gpio; + + const struct s6e3ha2_panel_desc *desc; }; static int s6e3ha2_dcs_write(struct s6e3ha2 *ctx, const void *data, size_t len) @@ -283,11 +296,19 @@ static int s6e3ha2_single_dsi_set(struct s6e3ha2 *ctx) static int s6e3ha2_freq_calibration(struct s6e3ha2 *ctx) { s6e3ha2_dcs_write_seq_static(ctx, 0xfd, 0x1c); + if (ctx->desc->type == EDGE_TYPE) + s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67, 0x40, 0xc5); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20, 0x39); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0xa0); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20); - s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, 0x40, - 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); + + if (ctx->desc->type == DEFAULT_TYPE) + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); + else + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x14, 0x6d, + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); + return 0; } @@ -597,16 +618,41 @@ static int s6e3ha2_enable(struct drm_panel *panel) .flags = 0, }; +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2 = { + .mode = &default_mode, + .type = DEFAULT_TYPE, +}; + +static const struct drm_display_mode edge_mode = { + .clock = 247856, + .hdisplay = 1600, + .hsync_start = 1600 + 1, + .hsync_end = 1600 + 1 + 1, + .htotal = 1600 + 1 + 1 + 1, + .vdisplay = 2560, + .vsync_start = 2560 + 1, + .vsync_end = 2560 + 1 + 1, + .vtotal = 2560 + 1 + 1 + 15, + .vrefresh = 60, + .flags = 0, +}; + +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2e = { + .mode = &edge_mode, + .type = EDGE_TYPE, +}; + static int s6e3ha2_get_modes(struct drm_panel *panel) { struct drm_connector *connector = panel->connector; + struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(panel->drm, ctx->desc->mode); if (!mode) { DRM_ERROR("failed to add mode %ux%ux@%u\n", - default_mode.hdisplay, default_mode.vdisplay, - default_mode.vrefresh); + ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, + ctx->desc->mode->vrefresh); return -ENOMEM; } @@ -642,6 +688,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) mipi_dsi_set_drvdata(dsi, ctx); ctx->dev = dev; + ctx->desc = of_device_get_match_data(dev); dsi->lanes = 4; dsi->format = MIPI_DSI_FMT_RGB888; @@ -717,7 +764,10 @@ static int s6e3ha2_remove(struct mipi_dsi_device *dsi) } static const struct of_device_id s6e3ha2_of_match[] = { - { .compatible = "samsung,s6e3ha2" }, + { .compatible = "samsung,s6e3ha2", + .data = &samsung_s6e3ha2_tm2 }, + { .compatible = "samsung,s6e3ha2-e", + .data = &samsung_s6e3ha2_tm2e }, { } }; MODULE_DEVICE_TABLE(of, s6e3ha2_of_match); -- 1.9.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/3] drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: linux-arm-kernel This patch considers edge type of panel on TM2e board and The panel has 1600x2560 resolution in 5.65" physical panel in the TM2e device. This identify panel type with compatibility string, also invoke display mode that matches the type. So add the check code for default compatibility and edge type and select the drm_display_mode of default and edge type. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 62 ++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c index 4cc08d7..b4a064a 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -16,6 +16,7 @@ #include <drm/drm_panel.h> #include <linux/backlight.h> #include <linux/gpio/consumer.h> +#include <linux/of_device.h> #include <linux/regulator/consumer.h> #define S6E3HA2_MIN_BRIGHTNESS 0 @@ -218,6 +219,16 @@ 0x1d, 0x1e, 0x1f, 0x20, 0x21 }; +enum s6e3ha2_type { + DEFAULT_TYPE, + EDGE_TYPE, +}; + +struct s6e3ha2_panel_desc { + const struct drm_display_mode *mode; + enum s6e3ha2_type type; +}; + struct s6e3ha2 { struct device *dev; struct drm_panel panel; @@ -226,6 +237,8 @@ struct s6e3ha2 { struct regulator_bulk_data supplies[2]; struct gpio_desc *reset_gpio; struct gpio_desc *enable_gpio; + + const struct s6e3ha2_panel_desc *desc; }; static int s6e3ha2_dcs_write(struct s6e3ha2 *ctx, const void *data, size_t len) @@ -283,11 +296,19 @@ static int s6e3ha2_single_dsi_set(struct s6e3ha2 *ctx) static int s6e3ha2_freq_calibration(struct s6e3ha2 *ctx) { s6e3ha2_dcs_write_seq_static(ctx, 0xfd, 0x1c); + if (ctx->desc->type == EDGE_TYPE) + s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67, 0x40, 0xc5); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20, 0x39); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0xa0); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20); - s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, 0x40, - 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); + + if (ctx->desc->type == DEFAULT_TYPE) + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); + else + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x14, 0x6d, + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); + return 0; } @@ -597,16 +618,41 @@ static int s6e3ha2_enable(struct drm_panel *panel) .flags = 0, }; +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2 = { + .mode = &default_mode, + .type = DEFAULT_TYPE, +}; + +static const struct drm_display_mode edge_mode = { + .clock = 247856, + .hdisplay = 1600, + .hsync_start = 1600 + 1, + .hsync_end = 1600 + 1 + 1, + .htotal = 1600 + 1 + 1 + 1, + .vdisplay = 2560, + .vsync_start = 2560 + 1, + .vsync_end = 2560 + 1 + 1, + .vtotal = 2560 + 1 + 1 + 15, + .vrefresh = 60, + .flags = 0, +}; + +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2e = { + .mode = &edge_mode, + .type = EDGE_TYPE, +}; + static int s6e3ha2_get_modes(struct drm_panel *panel) { struct drm_connector *connector = panel->connector; + struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(panel->drm, &default_mode); + mode = drm_mode_duplicate(panel->drm, ctx->desc->mode); if (!mode) { DRM_ERROR("failed to add mode %ux%ux@%u\n", - default_mode.hdisplay, default_mode.vdisplay, - default_mode.vrefresh); + ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, + ctx->desc->mode->vrefresh); return -ENOMEM; } @@ -642,6 +688,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) mipi_dsi_set_drvdata(dsi, ctx); ctx->dev = dev; + ctx->desc = of_device_get_match_data(dev); dsi->lanes = 4; dsi->format = MIPI_DSI_FMT_RGB888; @@ -717,7 +764,10 @@ static int s6e3ha2_remove(struct mipi_dsi_device *dsi) } static const struct of_device_id s6e3ha2_of_match[] = { - { .compatible = "samsung,s6e3ha2" }, + { .compatible = "samsung,s6e3ha2", + .data = &samsung_s6e3ha2_tm2 }, + { .compatible = "samsung,s6e3ha2-e", + .data = &samsung_s6e3ha2_tm2e }, { } }; MODULE_DEVICE_TABLE(of, s6e3ha2_of_match); -- 1.9.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board 2017-04-14 5:19 ` Hoegeun Kwon (?) @ 2017-04-14 8:26 ` Andrzej Hajda -1 siblings, 0 replies; 18+ messages in thread From: Andrzej Hajda @ 2017-04-14 8:26 UTC (permalink / raw) To: Hoegeun Kwon, thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: dri-devel, devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel, javier, andi.shyti Hi Hoegeun, The patch looks OK, below small nitpicks. On 14.04.2017 07:19, Hoegeun Kwon wrote: > This patch considers edge type of panel on TM2e board and The panel > has 1600x2560 resolution in 5.65" physical panel in the TM2e device. > > This identify panel type with compatibility string, also invoke > display mode that matches the type. So add the check code for default > compatibility and edge type and select the drm_display_mode of default > and edge type. > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 62 ++++++++++++++++++++++++--- > 1 file changed, 56 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > index 4cc08d7..b4a064a 100644 > --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > @@ -16,6 +16,7 @@ > #include <drm/drm_panel.h> > #include <linux/backlight.h> > #include <linux/gpio/consumer.h> > +#include <linux/of_device.h> > #include <linux/regulator/consumer.h> > > #define S6E3HA2_MIN_BRIGHTNESS 0 > @@ -218,6 +219,16 @@ > 0x1d, 0x1e, 0x1f, 0x20, 0x21 > }; > > +enum s6e3ha2_type { > + DEFAULT_TYPE, > + EDGE_TYPE, > +}; I am not sure if default is the best name, it suggest some hierarchy which is not true. Also edge does not fit here well, it is just buzzword used for marketing. Alternative enums: - S6E3HA2_TYPE, S6E3HF2_TYPE, quite long, hard to catch difference, but consistent with compatibles, - HA2_TYPE, HF2_TYPE - shorter, more readable version, - QHD_TYPE, WQXGA_TYPE - to empahsize resolutions. > + > +struct s6e3ha2_panel_desc { > + const struct drm_display_mode *mode; > + enum s6e3ha2_type type; > +}; > + > struct s6e3ha2 { > struct device *dev; > struct drm_panel panel; > @@ -226,6 +237,8 @@ struct s6e3ha2 { > struct regulator_bulk_data supplies[2]; > struct gpio_desc *reset_gpio; > struct gpio_desc *enable_gpio; > + > + const struct s6e3ha2_panel_desc *desc; > }; > > static int s6e3ha2_dcs_write(struct s6e3ha2 *ctx, const void *data, size_t len) > @@ -283,11 +296,19 @@ static int s6e3ha2_single_dsi_set(struct s6e3ha2 *ctx) > static int s6e3ha2_freq_calibration(struct s6e3ha2 *ctx) > { > s6e3ha2_dcs_write_seq_static(ctx, 0xfd, 0x1c); > + if (ctx->desc->type == EDGE_TYPE) > + s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67, 0x40, 0xc5); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20, 0x39); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0xa0); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20); > - s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, 0x40, > - 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + > + if (ctx->desc->type == DEFAULT_TYPE) > + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, > + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + else > + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x14, 0x6d, > + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + > return 0; > } > > @@ -597,16 +618,41 @@ static int s6e3ha2_enable(struct drm_panel *panel) > .flags = 0, > }; > > +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2 = { Please do not use tm2/tm2e here and later, they have nothing to do with the panel. > + .mode = &default_mode, > + .type = DEFAULT_TYPE, > +}; > + > +static const struct drm_display_mode edge_mode = { > + .clock = 247856, > + .hdisplay = 1600, > + .hsync_start = 1600 + 1, > + .hsync_end = 1600 + 1 + 1, > + .htotal = 1600 + 1 + 1 + 1, > + .vdisplay = 2560, > + .vsync_start = 2560 + 1, > + .vsync_end = 2560 + 1 + 1, > + .vtotal = 2560 + 1 + 1 + 15, > + .vrefresh = 60, > + .flags = 0, > +}; > + > +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2e = { > + .mode = &edge_mode, > + .type = EDGE_TYPE, > +}; > + > static int s6e3ha2_get_modes(struct drm_panel *panel) > { > struct drm_connector *connector = panel->connector; > + struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); > struct drm_display_mode *mode; > > - mode = drm_mode_duplicate(panel->drm, &default_mode); > + mode = drm_mode_duplicate(panel->drm, ctx->desc->mode); > if (!mode) { > DRM_ERROR("failed to add mode %ux%ux@%u\n", > - default_mode.hdisplay, default_mode.vdisplay, > - default_mode.vrefresh); > + ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, > + ctx->desc->mode->vrefresh); > return -ENOMEM; > } > > @@ -642,6 +688,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) > mipi_dsi_set_drvdata(dsi, ctx); > > ctx->dev = dev; > + ctx->desc = of_device_get_match_data(dev); > > dsi->lanes = 4; > dsi->format = MIPI_DSI_FMT_RGB888; > @@ -717,7 +764,10 @@ static int s6e3ha2_remove(struct mipi_dsi_device *dsi) > } > > static const struct of_device_id s6e3ha2_of_match[] = { > - { .compatible = "samsung,s6e3ha2" }, > + { .compatible = "samsung,s6e3ha2", > + .data = &samsung_s6e3ha2_tm2 }, > + { .compatible = "samsung,s6e3ha2-e", > + .data = &samsung_s6e3ha2_tm2e }, And please use compatible "samsung,s6e3hf2". Regards Andrzej > { } > }; > MODULE_DEVICE_TABLE(of, s6e3ha2_of_match); ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/3] drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board @ 2017-04-14 8:26 ` Andrzej Hajda 0 siblings, 0 replies; 18+ messages in thread From: Andrzej Hajda @ 2017-04-14 8:26 UTC (permalink / raw) To: linux-arm-kernel Hi Hoegeun, The patch looks OK, below small nitpicks. On 14.04.2017 07:19, Hoegeun Kwon wrote: > This patch considers edge type of panel on TM2e board and The panel > has 1600x2560 resolution in 5.65" physical panel in the TM2e device. > > This identify panel type with compatibility string, also invoke > display mode that matches the type. So add the check code for default > compatibility and edge type and select the drm_display_mode of default > and edge type. > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 62 ++++++++++++++++++++++++--- > 1 file changed, 56 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > index 4cc08d7..b4a064a 100644 > --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > @@ -16,6 +16,7 @@ > #include <drm/drm_panel.h> > #include <linux/backlight.h> > #include <linux/gpio/consumer.h> > +#include <linux/of_device.h> > #include <linux/regulator/consumer.h> > > #define S6E3HA2_MIN_BRIGHTNESS 0 > @@ -218,6 +219,16 @@ > 0x1d, 0x1e, 0x1f, 0x20, 0x21 > }; > > +enum s6e3ha2_type { > + DEFAULT_TYPE, > + EDGE_TYPE, > +}; I am not sure if default is the best name, it suggest some hierarchy which is not true. Also edge does not fit here well, it is just buzzword used for marketing. Alternative enums: - S6E3HA2_TYPE, S6E3HF2_TYPE, quite long, hard to catch difference, but consistent with compatibles, - HA2_TYPE, HF2_TYPE - shorter, more readable version, - QHD_TYPE, WQXGA_TYPE - to empahsize resolutions. > + > +struct s6e3ha2_panel_desc { > + const struct drm_display_mode *mode; > + enum s6e3ha2_type type; > +}; > + > struct s6e3ha2 { > struct device *dev; > struct drm_panel panel; > @@ -226,6 +237,8 @@ struct s6e3ha2 { > struct regulator_bulk_data supplies[2]; > struct gpio_desc *reset_gpio; > struct gpio_desc *enable_gpio; > + > + const struct s6e3ha2_panel_desc *desc; > }; > > static int s6e3ha2_dcs_write(struct s6e3ha2 *ctx, const void *data, size_t len) > @@ -283,11 +296,19 @@ static int s6e3ha2_single_dsi_set(struct s6e3ha2 *ctx) > static int s6e3ha2_freq_calibration(struct s6e3ha2 *ctx) > { > s6e3ha2_dcs_write_seq_static(ctx, 0xfd, 0x1c); > + if (ctx->desc->type == EDGE_TYPE) > + s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67, 0x40, 0xc5); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20, 0x39); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0xa0); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20); > - s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, 0x40, > - 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + > + if (ctx->desc->type == DEFAULT_TYPE) > + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, > + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + else > + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x14, 0x6d, > + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + > return 0; > } > > @@ -597,16 +618,41 @@ static int s6e3ha2_enable(struct drm_panel *panel) > .flags = 0, > }; > > +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2 = { Please do not use tm2/tm2e here and later, they have nothing to do with the panel. > + .mode = &default_mode, > + .type = DEFAULT_TYPE, > +}; > + > +static const struct drm_display_mode edge_mode = { > + .clock = 247856, > + .hdisplay = 1600, > + .hsync_start = 1600 + 1, > + .hsync_end = 1600 + 1 + 1, > + .htotal = 1600 + 1 + 1 + 1, > + .vdisplay = 2560, > + .vsync_start = 2560 + 1, > + .vsync_end = 2560 + 1 + 1, > + .vtotal = 2560 + 1 + 1 + 15, > + .vrefresh = 60, > + .flags = 0, > +}; > + > +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2e = { > + .mode = &edge_mode, > + .type = EDGE_TYPE, > +}; > + > static int s6e3ha2_get_modes(struct drm_panel *panel) > { > struct drm_connector *connector = panel->connector; > + struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); > struct drm_display_mode *mode; > > - mode = drm_mode_duplicate(panel->drm, &default_mode); > + mode = drm_mode_duplicate(panel->drm, ctx->desc->mode); > if (!mode) { > DRM_ERROR("failed to add mode %ux%ux@%u\n", > - default_mode.hdisplay, default_mode.vdisplay, > - default_mode.vrefresh); > + ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, > + ctx->desc->mode->vrefresh); > return -ENOMEM; > } > > @@ -642,6 +688,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) > mipi_dsi_set_drvdata(dsi, ctx); > > ctx->dev = dev; > + ctx->desc = of_device_get_match_data(dev); > > dsi->lanes = 4; > dsi->format = MIPI_DSI_FMT_RGB888; > @@ -717,7 +764,10 @@ static int s6e3ha2_remove(struct mipi_dsi_device *dsi) > } > > static const struct of_device_id s6e3ha2_of_match[] = { > - { .compatible = "samsung,s6e3ha2" }, > + { .compatible = "samsung,s6e3ha2", > + .data = &samsung_s6e3ha2_tm2 }, > + { .compatible = "samsung,s6e3ha2-e", > + .data = &samsung_s6e3ha2_tm2e }, And please use compatible "samsung,s6e3hf2". Regards Andrzej > { } > }; > MODULE_DEVICE_TABLE(of, s6e3ha2_of_match); ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board @ 2017-04-14 8:26 ` Andrzej Hajda 0 siblings, 0 replies; 18+ messages in thread From: Andrzej Hajda @ 2017-04-14 8:26 UTC (permalink / raw) To: Hoegeun Kwon, thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: devicetree, linux-samsung-soc, linux-kernel, dri-devel, javier, andi.shyti, linux-arm-kernel Hi Hoegeun, The patch looks OK, below small nitpicks. On 14.04.2017 07:19, Hoegeun Kwon wrote: > This patch considers edge type of panel on TM2e board and The panel > has 1600x2560 resolution in 5.65" physical panel in the TM2e device. > > This identify panel type with compatibility string, also invoke > display mode that matches the type. So add the check code for default > compatibility and edge type and select the drm_display_mode of default > and edge type. > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 62 ++++++++++++++++++++++++--- > 1 file changed, 56 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > index 4cc08d7..b4a064a 100644 > --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c > @@ -16,6 +16,7 @@ > #include <drm/drm_panel.h> > #include <linux/backlight.h> > #include <linux/gpio/consumer.h> > +#include <linux/of_device.h> > #include <linux/regulator/consumer.h> > > #define S6E3HA2_MIN_BRIGHTNESS 0 > @@ -218,6 +219,16 @@ > 0x1d, 0x1e, 0x1f, 0x20, 0x21 > }; > > +enum s6e3ha2_type { > + DEFAULT_TYPE, > + EDGE_TYPE, > +}; I am not sure if default is the best name, it suggest some hierarchy which is not true. Also edge does not fit here well, it is just buzzword used for marketing. Alternative enums: - S6E3HA2_TYPE, S6E3HF2_TYPE, quite long, hard to catch difference, but consistent with compatibles, - HA2_TYPE, HF2_TYPE - shorter, more readable version, - QHD_TYPE, WQXGA_TYPE - to empahsize resolutions. > + > +struct s6e3ha2_panel_desc { > + const struct drm_display_mode *mode; > + enum s6e3ha2_type type; > +}; > + > struct s6e3ha2 { > struct device *dev; > struct drm_panel panel; > @@ -226,6 +237,8 @@ struct s6e3ha2 { > struct regulator_bulk_data supplies[2]; > struct gpio_desc *reset_gpio; > struct gpio_desc *enable_gpio; > + > + const struct s6e3ha2_panel_desc *desc; > }; > > static int s6e3ha2_dcs_write(struct s6e3ha2 *ctx, const void *data, size_t len) > @@ -283,11 +296,19 @@ static int s6e3ha2_single_dsi_set(struct s6e3ha2 *ctx) > static int s6e3ha2_freq_calibration(struct s6e3ha2 *ctx) > { > s6e3ha2_dcs_write_seq_static(ctx, 0xfd, 0x1c); > + if (ctx->desc->type == EDGE_TYPE) > + s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67, 0x40, 0xc5); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20, 0x39); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0xa0); > s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20); > - s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, 0x40, > - 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + > + if (ctx->desc->type == DEFAULT_TYPE) > + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, > + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + else > + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x14, 0x6d, > + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); > + > return 0; > } > > @@ -597,16 +618,41 @@ static int s6e3ha2_enable(struct drm_panel *panel) > .flags = 0, > }; > > +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2 = { Please do not use tm2/tm2e here and later, they have nothing to do with the panel. > + .mode = &default_mode, > + .type = DEFAULT_TYPE, > +}; > + > +static const struct drm_display_mode edge_mode = { > + .clock = 247856, > + .hdisplay = 1600, > + .hsync_start = 1600 + 1, > + .hsync_end = 1600 + 1 + 1, > + .htotal = 1600 + 1 + 1 + 1, > + .vdisplay = 2560, > + .vsync_start = 2560 + 1, > + .vsync_end = 2560 + 1 + 1, > + .vtotal = 2560 + 1 + 1 + 15, > + .vrefresh = 60, > + .flags = 0, > +}; > + > +static const struct s6e3ha2_panel_desc samsung_s6e3ha2_tm2e = { > + .mode = &edge_mode, > + .type = EDGE_TYPE, > +}; > + > static int s6e3ha2_get_modes(struct drm_panel *panel) > { > struct drm_connector *connector = panel->connector; > + struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); > struct drm_display_mode *mode; > > - mode = drm_mode_duplicate(panel->drm, &default_mode); > + mode = drm_mode_duplicate(panel->drm, ctx->desc->mode); > if (!mode) { > DRM_ERROR("failed to add mode %ux%ux@%u\n", > - default_mode.hdisplay, default_mode.vdisplay, > - default_mode.vrefresh); > + ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, > + ctx->desc->mode->vrefresh); > return -ENOMEM; > } > > @@ -642,6 +688,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) > mipi_dsi_set_drvdata(dsi, ctx); > > ctx->dev = dev; > + ctx->desc = of_device_get_match_data(dev); > > dsi->lanes = 4; > dsi->format = MIPI_DSI_FMT_RGB888; > @@ -717,7 +764,10 @@ static int s6e3ha2_remove(struct mipi_dsi_device *dsi) > } > > static const struct of_device_id s6e3ha2_of_match[] = { > - { .compatible = "samsung,s6e3ha2" }, > + { .compatible = "samsung,s6e3ha2", > + .data = &samsung_s6e3ha2_tm2 }, > + { .compatible = "samsung,s6e3ha2-e", > + .data = &samsung_s6e3ha2_tm2e }, And please use compatible "samsung,s6e3hf2". Regards Andrzej > { } > }; > MODULE_DEVICE_TABLE(of, s6e3ha2_of_match); _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 18+ messages in thread
[parent not found: <CGME20170414051959epcas1p3a246070b065129c4ffbf94736cde321a@epcas1p3.samsung.com>]
* [PATCH 3/3] arm64: dts: exynos: Add support for S6E3HA2 edge panel device on TM2e board [not found] ` <CGME20170414051959epcas1p3a246070b065129c4ffbf94736cde321a@epcas1p3.samsung.com> 2017-04-14 5:19 ` Hoegeun Kwon @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: dri-devel, devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel, javier, a.hajda, andi.shyti, Hoegeun Kwon This patch add the panel device tree node for S6E3HA2 edge display controller to TM2e dts. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts b/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts index 694717a..79f22f7 100644 --- a/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts +++ b/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts @@ -52,6 +52,18 @@ assigned-clock-rates = <278000000>, <400000000>; }; +&dsi { + panel@0 { + compatible = "samsung,s6e3ha2-e"; + reg = <0>; + vdd3-supply = <&ldo27_reg>; + vci-supply = <&ldo28_reg>; + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; + }; +}; + &ldo31_reg { regulator-name = "TSP_VDD_1.8V_AP"; regulator-min-microvolt = <1800000>; -- 1.9.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/3] arm64: dts: exynos: Add support for S6E3HA2 edge panel device on TM2e board @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: linux-arm-kernel This patch add the panel device tree node for S6E3HA2 edge display controller to TM2e dts. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts b/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts index 694717a..79f22f7 100644 --- a/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts +++ b/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts @@ -52,6 +52,18 @@ assigned-clock-rates = <278000000>, <400000000>; }; +&dsi { + panel at 0 { + compatible = "samsung,s6e3ha2-e"; + reg = <0>; + vdd3-supply = <&ldo27_reg>; + vci-supply = <&ldo28_reg>; + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; + }; +}; + &ldo31_reg { regulator-name = "TSP_VDD_1.8V_AP"; regulator-min-microvolt = <1800000>; -- 1.9.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/3] arm64: dts: exynos: Add support for S6E3HA2 edge panel device on TM2e board @ 2017-04-14 5:19 ` Hoegeun Kwon 0 siblings, 0 replies; 18+ messages in thread From: Hoegeun Kwon @ 2017-04-14 5:19 UTC (permalink / raw) To: thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, krzk Cc: devicetree, linux-samsung-soc, linux-kernel, dri-devel, javier, andi.shyti, Hoegeun Kwon, linux-arm-kernel This patch add the panel device tree node for S6E3HA2 edge display controller to TM2e dts. Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> --- arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts b/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts index 694717a..79f22f7 100644 --- a/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts +++ b/arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts @@ -52,6 +52,18 @@ assigned-clock-rates = <278000000>, <400000000>; }; +&dsi { + panel@0 { + compatible = "samsung,s6e3ha2-e"; + reg = <0>; + vdd3-supply = <&ldo27_reg>; + vci-supply = <&ldo28_reg>; + reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>; + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; + }; +}; + &ldo31_reg { regulator-name = "TSP_VDD_1.8V_AP"; regulator-min-microvolt = <1800000>; -- 1.9.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 3/3] arm64: dts: exynos: Add support for S6E3HA2 edge panel device on TM2e board 2017-04-14 5:19 ` Hoegeun Kwon @ 2017-04-14 9:03 ` Krzysztof Kozlowski -1 siblings, 0 replies; 18+ messages in thread From: Krzysztof Kozlowski @ 2017-04-14 9:03 UTC (permalink / raw) To: Hoegeun Kwon Cc: thierry.reding, airlied, robh+dt, mark.rutland, catalin.marinas, will.deacon, kgene, dri-devel, devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel, javier, a.hajda, andi.shyti On Fri, Apr 14, 2017 at 02:19:39PM +0900, Hoegeun Kwon wrote: > This patch add the panel device tree node for S6E3HA2 edge display > controller to TM2e dts. > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > Looks good to me but I see that bindings are discussed still. I'll take this when they settle. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/3] arm64: dts: exynos: Add support for S6E3HA2 edge panel device on TM2e board @ 2017-04-14 9:03 ` Krzysztof Kozlowski 0 siblings, 0 replies; 18+ messages in thread From: Krzysztof Kozlowski @ 2017-04-14 9:03 UTC (permalink / raw) To: linux-arm-kernel On Fri, Apr 14, 2017 at 02:19:39PM +0900, Hoegeun Kwon wrote: > This patch add the panel device tree node for S6E3HA2 edge display > controller to TM2e dts. > > Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> > --- > arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > Looks good to me but I see that bindings are discussed still. I'll take this when they settle. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2017-04-14 9:03 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20170414051958epcas5p379f82e72e9239fdea0b99de88c4c39f1@epcas5p3.samsung.com> 2017-04-14 5:19 ` [PATCH 0/3] Add support for the S6E3HA2 edge panel on TM2e board Hoegeun Kwon 2017-04-14 5:19 ` Hoegeun Kwon [not found] ` <CGME20170414051959epcas5p3917fe7adbc17a42bf0450a46b2baf55d@epcas5p3.samsung.com> 2017-04-14 5:19 ` [PATCH 1/3] dt-bindings: Add support for samsung s6e3ha2 edge panel binding Hoegeun Kwon 2017-04-14 5:19 ` Hoegeun Kwon 2017-04-14 5:19 ` Hoegeun Kwon 2017-04-14 7:33 ` Andrzej Hajda 2017-04-14 7:33 ` Andrzej Hajda 2017-04-14 7:33 ` Andrzej Hajda [not found] ` <CGME20170414051959epcas5p338f72abbf841233f6f1f0a240df2a1e9@epcas5p3.samsung.com> 2017-04-14 5:19 ` [PATCH 2/3] drm/panel: s6e3ha2: Add support for S6eHEA2 edge panel on TM2e board Hoegeun Kwon 2017-04-14 5:19 ` Hoegeun Kwon 2017-04-14 8:26 ` Andrzej Hajda 2017-04-14 8:26 ` Andrzej Hajda 2017-04-14 8:26 ` Andrzej Hajda [not found] ` <CGME20170414051959epcas1p3a246070b065129c4ffbf94736cde321a@epcas1p3.samsung.com> 2017-04-14 5:19 ` [PATCH 3/3] arm64: dts: exynos: Add support for S6E3HA2 edge panel device " Hoegeun Kwon 2017-04-14 5:19 ` Hoegeun Kwon 2017-04-14 5:19 ` Hoegeun Kwon 2017-04-14 9:03 ` Krzysztof Kozlowski 2017-04-14 9:03 ` Krzysztof Kozlowski
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.