soc_camera rcar_vin support for device-tree binding
This is a series of patches to get towards the point the renesas rcar_vin driver can be bound via device-tree. Patches 1 and 2 add the device tree nodes, patch 3 is one which has been in my tree for a while and the last two modify the rcar_vin driver.
PATCH 1/5 r8a7790.dtsi: add vin[0-3] nodes
Add nodes for the four video input channels on the R8A7790.
--- arch/arm/boot/dts/r8a7790.dtsi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
arch/arm/boot/dts/r8a7790.dtsi +32 -0
@@ -395,6 +395,38 @@ status = "disabled"; }; + vin0: vin@0xe6ef0000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN0>; + reg = <0 0xe6ef0000 0 0x1000>; + interrupts = <0 188 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + vin1: vin@0xe6ef1000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN1>; + reg = <0 0xe6ef1000 0 0x1000>; + interrupts = <0 189 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + vin2: vin@0xe6ef2000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN2>; + reg = <0 0xe6ef2000 0 0x1000>; + interrupts = <0 190 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + vin3: vin@0xe6ef3000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN3>; + reg = <0 0xe6ef3000 0 0x1000>; + interrupts = <0 191 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + clocks { #address-cells = <2>; #size-cells = <2>;
Signature · 1 line
1.9.0
Re: [PATCH 1/5] r8a7790.dtsi: add vin[0-3] nodes
Hello.
Quoted 3 lines · Ben Dooks
Add nodes for the four video input channels on the R8A7790.
Signed-off-by Ben Dooks <[email protected]>
This patch should have been preceded by the VIN driver patch and bindings
description, don't you think?
arch/arm/boot/dts/r8a7790.dtsi line 398
Quoted 9 lines
arch/arm/boot/dts/r8a7790.dtsi +1
-0@@ -395,6 +395,38 @@ status = "disabled"; }; + vin0: vin@0xe6ef0000 {
ePAPR standard [1] tells us that:
The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model.
So, I would suggest something like "video". And remove "0x" from the
address part of the node name please.
WBR, Sergei
Re: [PATCH 1/5] r8a7790.dtsi: add vin[0-3] nodes
Quoted 10 lines · Sergei Shtylyov
Hello.
Quoted 3 lines · Ben Dooks
Add nodes for the four video input channels on the R8A7790.
Signed-off-by Ben Dooks <[email protected]>This patch should have been preceded by the VIN driver patch and
bindings description, don't you think?
Given this is a pretty standard device and video input binding as already described in the relevant documentation, didn't really think it was necessary.
Quoted 13 lines
arch/arm/boot/dts/r8a7790.dtsi line 398
Quoted 10 lines
arch/arm/boot/dts/r8a7790.dtsi +1
-0@@ -395,6 +395,38 @@ status = "disabled"; }; + vin0: vin@0xe6ef0000 {ePAPR standard [1] tells us that:
Quoted 5 lines
The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model.
So, I would suggest something like "video". And remove "0x" from theaddress part of the node name please.
vin is a reasonable contraction of video-input.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
Re: [PATCH 1/5] r8a7790.dtsi: add vin[0-3] nodes
In reply to Ben DooksQuoted 1 line · Ben Dooks
Add nodes for the four video input channels on the R8A7790.
Please update the prefix of this subject of this patch to:
ARM: shmobile: r8a7790:
Quoted 57 lines
Signed-off-by Ben Dooks <[email protected]>--- arch/arm/boot/dts/r8a7790.dtsi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)arch/arm/boot/dts/r8a7790.dtsi +32
-0@@ -395,6 +395,38 @@ status = "disabled"; }; + vin0: vin@0xe6ef0000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN0>; + reg = <0 0xe6ef0000 0 0x1000>; + interrupts = <0 188 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + vin1: vin@0xe6ef1000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN1>; + reg = <0 0xe6ef1000 0 0x1000>; + interrupts = <0 189 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + vin2: vin@0xe6ef2000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN2>; + reg = <0 0xe6ef2000 0 0x1000>; + interrupts = <0 190 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + vin3: vin@0xe6ef3000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN3>; + reg = <0 0xe6ef3000 0 0x1000>; + interrupts = <0 191 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + clocks { #address-cells = <2>; #size-cells = <2>;Signature · 6 lines
1.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/5 ARM: lager: add vin1 node
In reply to Ben DooksAdd device-tree for vin1 (composite video in) on the lager board.
--- arch/arm/boot/dts/r8a7790-lager.dts | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
arch/arm/boot/dts/r8a7790-lager.dts +38 -0
@@ -158,6 +158,11 @@ renesas,groups = "i2c2"; renesas,function = "i2c2"; }; + + vin1_pins: vin { + renesas,groups = "vin1_data8", "vin1_clk"; + renesas,function = "vin1"; + }; }; &mmcif1 {
@@ -239,8 +244,41 @@ status = "ok"; pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; + + adv7180: adv7180@0x20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin1>; + + port { + adv7180_1: endpoint { + bus-width = <8>; + remote-endpoint = <&vin1ep0>; + }; + }; + }; + }; &i2c3 { status = "ok"; }; + +/* composite video input */ +&vin1 { + pinctrl-0 = <&vin1_pins>; + pinctrl-names = "default"; + + status = "ok"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + vin1ep0: endpoint { + remote-endpoint = <&adv7180_1>; + bus-width = <8>; + }; + }; +}; +
Signature · 1 line
1.9.0
Re: [PATCH 2/5] ARM: lager: add vin1 node
Hello.
Quoted 4 lines · Ben Dooks
Add device-tree for vin1 (composite video in) on the lager board.
Signed-off-by Ben Dooks <[email protected]>
This patch should have been preceded by the VIN driver patch and bindings
description, don't you think?
Quoted 4 lines
arch/arm/boot/dts/r8a7790-lager.dts +0
-0
[...]
arch/arm/boot/dts/r8a7790-lager.dts line 248
Quoted 6 lines
arch/arm/boot/dts/r8a7790-lager.dts +2
-0@@ -239,8 +244,41 @@ status = "ok"; pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; + + adv7180: adv7180@0x20 {
ePAPR standard [1] tells us that:
"The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model."
So, I would suggest something like "video-decoder" instead. And remove
"0x" from the address part of the node name please.
[1] http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf
WBR, Sergei
Re: [PATCH 2/5] ARM: lager: add vin1 node
Quoted 27 lines · Sergei Shtylyov
Hello.
Quoted 4 lines · Ben Dooks
Add device-tree for vin1 (composite video in) on the lager board.
Signed-off-by Ben Dooks <[email protected]>This patch should have been preceded by the VIN driver patch and
bindings description, don't you think?Quoted 5 lines
arch/arm/boot/dts/r8a7790-lager.dts +0
-0[...]
arch/arm/boot/dts/r8a7790-lager.dts line 248
Quoted 6 lines
arch/arm/boot/dts/r8a7790-lager.dts +2
-0@@ -239,8 +244,41 @@ status = "ok"; pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; + + adv7180: adv7180@0x20 {ePAPR standard [1] tells us that:
Quoted 5 lines
"The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model."
So, I would suggest something like "video-decoder" instead. And
remove "0x" from the address part of the node name please.
Personally I'm not fussed about names in the tree.
I will look at changing it to something like vin1_decoder
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
Re: [PATCH 2/5] ARM: lager: add vin1 node
Quoted 23 lines · Ben Dooks
Quoted 22 lines
Quoted 4 lines
Add device-tree for vin1 (composite video in) on the lager board.
Signed-off-by Ben Dooks <[email protected]>This patch should have been preceded by the VIN driver patch and
bindings description, don't you think?Quoted 5 lines
arch/arm/boot/dts/r8a7790-lager.dts +0
-0[...]
arch/arm/boot/dts/r8a7790-lager.dts line 248
Quoted 6 lines
arch/arm/boot/dts/r8a7790-lager.dts +2
-0@@ -239,8 +244,41 @@ status = "ok"; pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; + + adv7180: adv7180@0x20 {ePAPR standard [1] tells us that:
Quoted 7 lines
Quoted 5 lines
"The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model."
So, I would suggest something like "video-decoder" instead. And
remove "0x" from the address part of the node name please.Personally I'm not fussed about names in the tree.
I quoted the standard everybody should follow.
Quoted 1 line
I will look at changing it to something like
vin1_decoder
Please give it a generic name instead, without indexes and underscores.
WBR, Sergei
Re: [PATCH 2/5] ARM: lager: add vin1 node
In reply to Ben DooksQuoted 2 lines · Ben Dooks
Add device-tree for vin1 (composite video in) on the lager board.
Please update the prefix of the subject of this patch to:
ARM: shmobile: lager:
Quoted 72 lines
Signed-off-by Ben Dooks <[email protected]>--- arch/arm/boot/dts/r8a7790-lager.dts | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)arch/arm/boot/dts/r8a7790-lager.dts +38
-0@@ -158,6 +158,11 @@ renesas,groups = "i2c2"; renesas,function = "i2c2"; }; + + vin1_pins: vin { + renesas,groups = "vin1_data8", "vin1_clk"; + renesas,function = "vin1"; + }; }; &mmcif1 {@@ -239,8 +244,41 @@ status = "ok"; pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; + + adv7180: adv7180@0x20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin1>; + + port { + adv7180_1: endpoint { + bus-width = <8>; + remote-endpoint = <&vin1ep0>; + }; + }; + }; + }; &i2c3 { status = "ok"; }; + +/* composite video input */ +&vin1 { + pinctrl-0 = <&vin1_pins>; + pinctrl-names = "default"; + + status = "ok"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + vin1ep0: endpoint { + remote-endpoint = <&adv7180_1>; + bus-width = <8>; + }; + }; +}; +Signature · 6 lines
1.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/5 media: soc_camera: rcar_vin: Add support for 10-bit YUV cameras
In reply to Ben DooksFrom: Phil Edworthy <[email protected]>
--- drivers/media/platform/soc_camera/rcar_vin.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/media/platform/soc_camera/rcar_vin.c +9 -0
@@ -68,6 +68,8 @@#define VNMC_YCAL (1 << 19)#define VNMC_INF_YUV8_BT656 (0 << 16)#define VNMC_INF_YUV8_BT601 (1 << 16) +#define VNMC_INF_YUV10_BT656 (2 << 16) +#define VNMC_INF_YUV10_BT601 (3 << 16)#define VNMC_INF_YUV16 (5 << 16)#define VNMC_VUP (1 << 10)#define VNMC_IM_ODD (0 << 3)
@@ -275,6 +277,12 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)/* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ vnmc |= priv->pdata->flags &RCAR_VIN_BT656 ?VNMC_INF_YUV8_BT656 :VNMC_INF_YUV8_BT601 ; +break ; +case V4L2_MBUS_FMT_YUYV10_2X10 : +/* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */ + vnmc |= priv->pdata->flags &RCAR_VIN_BT656 ? +VNMC_INF_YUV10_BT656 :VNMC_INF_YUV10_BT601 ; +break ;default :break ; }
@@ -1003,6 +1011,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,switch (code) {case V4L2_MBUS_FMT_YUYV8_1X16 :case V4L2_MBUS_FMT_YUYV8_2X8 : +case V4L2_MBUS_FMT_YUYV10_2X10 :if (cam->extra_fmt)break ;
Signature · 1 line
1.9.0
PATCH 4/5 rcar_vin: copy flags from pdata
In reply to Ben DooksThe platform data is a single word, so simply copy it into the device's private data structure than keeping a copy of the pointer.
This will make changing to device-tree binding easier as it is one allocation instead of two.
--- drivers/media/platform/soc_camera/rcar_vin.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/media/platform/soc_camera/rcar_vin.c +6 -6
@@ -126,13 +126,13 @@ struct rcar_vin_priv {int sequence;/* State of the VIN module in capturing mode */ enum rcar_vin_state state; -struct rcar_vin_platform_data *pdata;struct soc_camera_host ici;struct list_head capture;#define MAX_BUFFER_NUM 3struct vb2_buffer *queue_buf[MAX_BUFFER_NUM ];struct vb2_alloc_ctx *alloc_ctx;enum v4l2_field field; +unsigned int pdata_flags;unsigned int vb_count;unsigned int nr_hw_slots;bool request_to_stop;
@@ -275,12 +275,12 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)break ;case V4L2_MBUS_FMT_YUYV8_2X8 :/* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ - vnmc |= priv->pdata->flags &RCAR_VIN_BT656 ? + vnmc |= priv->pdata_flags &RCAR_VIN_BT656 ?VNMC_INF_YUV8_BT656 :VNMC_INF_YUV8_BT601 ;break ;case V4L2_MBUS_FMT_YUYV10_2X10 :/* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */ - vnmc |= priv->pdata->flags &RCAR_VIN_BT656 ? + vnmc |= priv->pdata_flags &RCAR_VIN_BT656 ?VNMC_INF_YUV10_BT656 :VNMC_INF_YUV10_BT601 ;break ;default :
@@ -799,7 +799,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd)/* Make choises, based on platform preferences */ if ((common_flags &V4L2_MBUS_HSYNC_ACTIVE_HIGH ) && (common_flags &V4L2_MBUS_HSYNC_ACTIVE_LOW )) { -if (priv->pdata->flags &RCAR_VIN_HSYNC_ACTIVE_LOW ) +if (priv->pdata_flags &RCAR_VIN_HSYNC_ACTIVE_LOW ) common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_HIGH ;else common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_LOW ;
@@ -807,7 +807,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd)if ((common_flags &V4L2_MBUS_VSYNC_ACTIVE_HIGH ) && (common_flags &V4L2_MBUS_VSYNC_ACTIVE_LOW )) { -if (priv->pdata->flags &RCAR_VIN_VSYNC_ACTIVE_LOW ) +if (priv->pdata_flags &RCAR_VIN_VSYNC_ACTIVE_LOW ) common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH ;else common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW ;
@@ -1447,7 +1447,7 @@ static int rcar_vin_probe(struct platform_device *pdev) priv->ici.drv_name =dev_name (&pdev->dev); priv->ici.ops = &rcar_vin_host_ops; - priv->pdata = pdata; + priv->pdata_flags = pdata->flags; priv->chip = pdev->id_entry->driver_data;spin_lock_init (&priv->lock);INIT_LIST_HEAD (&priv->capture);
Signature · 1 line
1.9.0
PATCH 5/5 rcar_vin: add devicetree support
In reply to Ben DooksAdd support for devicetree probe for the rcar-vin
driver.
--- .../devicetree/bindings/media/rcar_vin.txt | 79 ++++++++++++++++++++++ drivers/media/platform/soc_camera/rcar_vin.c | 67 ++++++++++++++++-- 2 files changed, 140 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/rcar_vin.txt
Documentation/devicetree/bindings/media/rcar_vin.txt new file +79 -0
@@ -0,0 +1,79 @@ +Renesas RCar Video Input driver (rcar_vin) +------------------------------------------ + +The rcar_vin device provides video input capabilities for the Renesas R-Car +family of devices. The current blocks are always slaves and suppot one input +channel which can be either RGB, YUYV or BT656. + + - compatible: Must be one of the following + - "renesas,vin-r8a7791" for the R8A7791 device + - "renesas,vin-r8a7790" for the R8A7790 device + - "renesas,vin-r8a7779" for the R8A7779 device + - "renesas,vin-r8a7778" for the R8A7778 device + - reg: the register base and size for the device registers + - interrupts: the interrupt for the device + - clocks: Reference to the parent clock + +The per-board settings: + - port sub-node describing a single endpoint connected to the vin + as described in video-interfaces.txt[1]. Only the first one will + be considered as each vin interface has one input port. + + These settings are used to work out video input format and widths + into the system. + + +Device node example +------------------- + + vin0: vin@0xe6ef0000 { + compatible = "renesas,vin-r8a7790"; + clocks = <&mstp8_clks R8A7790_CLK_VIN0>; + reg = <0 0xe6ef0000 0 0x1000>; + interrupts = <0 188 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + +Board setup example (vin1 composite video input) +------------------------------------------------ + +&i2c2 { + status = "ok"; + pinctrl-0 = <&i2c2_pins>; + pinctrl-names = "default"; + + adv7180: adv7180@0x20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin1>; + + port { + adv7180_1: endpoint { + bus-width = <8>; + remote-endpoint = <&vin1ep0>; + }; + }; + }; +}; + +/* composite video input */ +&vin1 { + pinctrl-0 = <&vin1_pins>; + pinctrl-names = "default"; + + status = "ok"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + vin1ep0: endpoint { + remote-endpoint = <&adv7180_1>; + bus-width = <8>; + }; + }; +}; + + + +[1] video-interfaces.txt common video media interface
drivers/media/platform/soc_camera/rcar_vin.c +61 -6
108 lines not on this page · raw message
Signature · 1 line
1.9.0
Re: [PATCH 5/5] rcar_vin: add devicetree support
Quoted 3 lines · Ben Dooks
+++
b/Documentation/devicetree/bindings/media/rcar_vin.txt+family of devices. The current blocks are always slaves and suppot one input
support
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 5/5] rcar_vin: add devicetree support
In reply to Ben DooksHello.
Quoted 16 lines · Ben Dooks
Add support for devicetree probe for the rcar-vin
driver.Signed-off-by Ben Dooks <[email protected]>--- .../devicetree/bindings/media/rcar_vin.txt | 79 ++++++++++++++++++++++ drivers/media/platform/soc_camera/rcar_vin.c | 67 ++++++++++++++++-- 2 files changed, 140 insertions(+), 6 deletions(-)create mode 100644
Documentation/devicetree/bindings/media/rcar_vin.txtDocumentation/devicetree/bindings/media/rcar_vin.txt new file +0
-0
Documentation/devicetree/bindings/media/rcar_vin.txt line 5
Quoted 5 lines
Documentation/devicetree/bindings/media/rcar_vin.txt new file +5
-0@@ -0,0 +1,79 @@ +Renesas RCar Video Input driver (rcar_vin) +------------------------------------------ + +The rcar_vin device provides video input capabilities for the Renesas R-Car +family of devices. The current blocks are always slaves and suppot one input
Support.
Documentation/devicetree/bindings/media/rcar_vin.txt line 18
Quoted 13 lines
Documentation/devicetree/bindings/media/rcar_vin.txt new file +13
-0+channel which can be either RGB, YUYV or BT656. + + - compatible: Must be one of the following + - "renesas,vin-r8a7791" for the R8A7791 device + - "renesas,vin-r8a7790" for the R8A7790 device + - "renesas,vin-r8a7779" for the R8A7779 device + - "renesas,vin-r8a7778" for the R8A7778 device + - reg: the register base and size for the device registers + - interrupts: the interrupt for the device + - clocks: Reference to the parent clock + +The per-board settings: + - port sub-node describing a single endpoint connected to the vin
s/vin/VIN/.
Quoted 2 lines
Documentation/devicetree/bindings/media/rcar_vin.txt new file +2
-0+ as described in video-interfaces.txt[1]. Only the first one will + be considered as each vin interface has one input port.
[...]
Quoted 31 lines
drivers/media/platform/soc_camera/rcar_vin.c +14
-4@@ -1404,15 +1418,50 @@ MODULE_DEVICE_TABLE(platform, rcar_vin_id_table);static int rcar_vin_probe (struct platform_device *pdev) { +const struct of_device_id *match =NULL ;struct rcar_vin_priv *priv;struct resource *mem;struct rcar_vin_platform_data *pdata; +unsigned int pdata_flags;int irq, ret; - pdata = pdev->dev.platform_data; -if (!pdata || !pdata->flags) { -dev_err (&pdev->dev,"platform data not set\n" ); -return -EINVAL ; +if (pdev->dev.of_node) { +struct v4l2_of_endpoint ep; +struct device_node *np; + + match =of_match_device (of_match_ptr (rcar_vin_of_table), + &pdev->dev); + + np =v4l2_of_get_next_endpoint (pdev->dev.of_node,NULL ); +if (!np) { +dev_err (&pdev->dev,"could not find endpoint\n" ); +return -EINVAL ; + }
drivers/media/platform/soc_camera/rcar_vin.c MODULE_DEVICE_TABLE(platform, rcar_vin_id_table); · line 1449
Quoted 10 lines
drivers/media/platform/soc_camera/rcar_vin.c +10
-0+ + ret =v4l2_of_parse_endpoint (np, &ep); +if (ret) { +dev_err (&pdev->dev,"could not parse endpoint\n" ); +return ret; + } + +if (ep.bus_type ==V4L2_MBUS_BT656 ) + pdata_flags =RCAR_VIN_BT656 ; +else {
Both arms of *if* should have {} -- see Documentation/CodingStyle.
drivers/media/platform/soc_camera/rcar_vin.c MODULE_DEVICE_TABLE(platform, rcar_vin_id_table); · line 1459
Quoted 10 lines
drivers/media/platform/soc_camera/rcar_vin.c +10
-0+ pdata_flags =0 ; +if (ep.bus.parallel.flags &V4L2_MBUS_HSYNC_ACTIVE_LOW ) + pdata_flags |=RCAR_VIN_HSYNC_ACTIVE_LOW ; +if (ep.bus.parallel.flags &V4L2_MBUS_VSYNC_ACTIVE_LOW ) + pdata_flags |=RCAR_VIN_VSYNC_ACTIVE_LOW ; + } + +dev_dbg (&pdev->dev,"pdata_flags = %08x\n" , pdata_flags); + }else { + pdata = pdev->dev.platform_data;
Use dev_get_platdata(&pdev->dev), please. Lot of drivers have been
converted to use it instead of the direct access. Haven't gotten to this one it seems.
drivers/media/platform/soc_camera/rcar_vin.c static int rcar_vin_probe(struct platform_device *pdev) · line 1505
Quoted 13 lines
drivers/media/platform/soc_camera/rcar_vin.c +7
-2@@ -1447,8 +1496,13 @@ static int rcar_vin_probe(struct platform_device *pdev) priv->ici.drv_name =dev_name (&pdev->dev); priv->ici.ops = &rcar_vin_host_ops; - priv->pdata_flags = pdata->flags; - priv->chip = pdev->id_entry->driver_data; + priv->pdata_flags = pdata_flags; +if (!match) + priv->chip = pdev->id_entry->driver_data; +else + priv->chip = (enum chip_id )match->data; + +
Too many empty lines here, I think.
WBR, Sergei
Re: [PATCH 5/5] rcar_vin: add devicetree support
In reply to Ben DooksHi Ben,
Quoted 2 lines · Ben Dooks
Add support for devicetree probe for the rcar-vin
driver.
Thanks for the patch. I'm afraid I don't quite understand how it is supposed to work though. AFAICS, the rcar_vin driver currently doesn't support asynchronous probing, so, your code is relying on a specific probing order? Besides, as of now soc-camera doesn't support OF probing. You mentioned, that you have a patch for soc-camera to add OF support. I think that and async probing for rcar_vin should be committed before this patch becomes meaningful.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Re: [PATCH 5/5] rcar_vin: add devicetree support
Hi Ben,
Since I never received a reply to this my query, I consider this your patch series suspended.
Thanks
Guennadi
Quoted 7 lines · Guennadi Liakhovetski
Hi Ben,
Quoted 2 lines · Ben Dooks
Add support for devicetree probe for the rcar-vin
driver.
Quoted 7 lines
Thanks for the patch. I'm afraid I don't quite understand how it is supposed to work though. AFAICS, the
rcar_vindriver currently doesn't support asynchronous probing, so, your code is relying on a specific probing order? Besides, as of now soc-camera doesn't support OF probing. You mentioned, that you have a patch for soc-camera to add OF support. I think that and async probing forrcar_vinshould be committed before this patch becomes meaningful.
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Re: [PATCH 5/5] rcar_vin: add devicetree support
Quoted 7 lines · Guennadi Liakhovetski
Hi Ben,
Since I never received a reply to this my query, I consider this your patch series suspended.
Thanks
Guennadi
I meant to send out a patch series for the of probe for soc_camera. The actual rcar_vin does not need much to support async probe, it is just the soc_camera that needs sorting.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
Re: [PATCH 5/5] rcar_vin: add devicetree support
Quoted 6 lines · Ben Dooks
Quoted 5 lines · Guennadi Liakhovetski
Hi Ben,
Since I never received a reply to this my query, I consider this your patch series suspended.
Quoted 6 lines
Quoted 2 lines
Thanks
GuennadiI meant to send out a patch series for the of probe for
soc_camera. The actualrcar_vindoes not need much to support async probe, it is just thesoc_camerathat needs sorting.
But without that soc-camera DT support your patches are non-functional, right?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Re: [PATCH 5/5] rcar_vin: add devicetree support
Quoted 11 lines · Guennadi Liakhovetski
Quoted 9 lines · Ben Dooks
Quoted 7 lines · Guennadi Liakhovetski
Hi Ben,
Since I never received a reply to this my query, I consider this your patch series suspended.
Thanks
Guennadi
Quoted 6 lines
Quoted 3 lines
I meant to send out a patch series for the of probe for
soc_camera. The actualrcar_vindoes not need much to support async probe, it is just thesoc_camerathat needs sorting.But without that soc-camera DT support your patches are non-functional, right?
They're not much use. I've sent the soc-camera patch out now for review. I will sort out sending patches for the async device changes for the device(s) on the lager board as soon as I can get some time to re-test.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius