소스 검색

Merge branch 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree into ti-linux-4.19.y

TI-Feature: audio-display
TI-Tree: git@git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git
TI-Branch: audio_display-ti-linux-4.19.y

* 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree: (21 commits)
  media: ti-vpe: vip: remove leftover __maybe_unused
  ARM: dts: dra76-evm: remove status from vip port nodes
  ARM: dts: dra72-evm-common: remove status from vip port nodes
  ARM: dts: dra7-evm: remove status from vip port nodes
  ARM: dts: am572x-idk-common: remove status from vip port nodes
  ARM: dts: am571x-idk: remove status from vip port nodes
  ARM: dts: ov10635: remove status from vip port nodes
  ARM: dts: mt9t111: remove status from vip port nodes
  media: ti-vpe: vip: fix DT port endpoint scanning
  ARM: dts: dra7: remove status from vip port nodes
  ARM: dts: dra7: group vip port nodes
  ARM: dts: dra76-evm: fix non bidirectional warning
  ARM: dts: dra72-evm-common: fix non bidirectional warning
  ARM: dts: dra7-evm: fix non bidirectional warning
  ARM: dts: am572x-idk-common: fix non bidirectional warning
  ARM: dts: am571x-idk: fix non bidirectional warning
  ARM: dts: ov10635: fix non bidirectional warning
  ARM: dts: mt9t111: fix non bidirectional warning
  media: i2c: mt9t11x: Fix unused return variable
  media: i2c: mt9t11x: Remove driver owner
  ...

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
LCPD Auto Merger 6 년 전
부모
커밋
90c20427f8

+ 2 - 4
arch/arm/boot/dts/am571x-idk.dts

@@ -116,13 +116,11 @@
 };
 
 &ov2659_1 {
-	remote-endpoint = <&vin1b>;
+	remote-endpoint = <&vin1b_ep>;
 };
 
 &vin1b {
-	status = "okay";
-
-	endpoint@2 {
+	vin1b_ep: endpoint@2 {
 		slave-mode;
 		remote-endpoint = <&ov2659_1>;
 	};

+ 2 - 4
arch/arm/boot/dts/am572x-idk-common.dtsi

@@ -96,13 +96,11 @@
 };
 
 &ov2659_1 {
-	remote-endpoint = <&vin4b>;
+	remote-endpoint = <&vin4b_ep>;
 };
 
 &vin4b {
-	status = "okay";
-
-	endpoint@3 {
+	vin4b_ep: endpoint@3 {
 		slave-mode;
 		remote-endpoint = <&ov2659_1>;
 	};

+ 2 - 3
arch/arm/boot/dts/dra7-evm.dts

@@ -354,7 +354,7 @@
 		mux-gpios = <&pcf_hdmi 3 GPIO_ACTIVE_LOW>; /* CAM_FPD_MUX_S0 */
 		port {
 			onboardLI: endpoint {
-				remote-endpoint = <&vin1a>;
+				remote-endpoint = <&vin1a_ep>;
 				hsync-active = <1>;
 				vsync-active = <1>;
 				pclk-sample = <0>;
@@ -550,8 +550,7 @@
 };
 
 &vin1a {
-	status = "okay";
-	endpoint@0 {
+	vin1a_ep: endpoint@0 {
 		slave-mode;
 		remote-endpoint = <&onboardLI>;
 	};

+ 14 - 21
arch/arm/boot/dts/dra7.dtsi

@@ -2153,29 +2153,22 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
-			vin1a: port@0 {
+			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				reg = <0>;
-				status = "disabled";
-			};
-			vin2a: port@1 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <1>;
-				status = "disabled";
-			};
-			vin1b: port@2 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <2>;
-				status = "disabled";
-			};
-			vin2b: port@3 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <3>;
-				status = "disabled";
+
+				vin1a: port@0 {
+					reg = <0>;
+				};
+				vin2a: port@1 {
+					reg = <1>;
+				};
+				vin1b: port@2 {
+					reg = <2>;
+				};
+				vin2b: port@3 {
+					reg = <3>;
+				};
 			};
 		};
 	};

+ 2 - 3
arch/arm/boot/dts/dra72-evm-common.dtsi

@@ -293,7 +293,7 @@
 			    <&pcf_hdmi 6	GPIO_ACTIVE_LOW>; /* VIN2_S2 */
 		port {
 			onboardLI: endpoint {
-				remote-endpoint = <&vin2a>;
+				remote-endpoint = <&vin2a_ep>;
 				hsync-active = <1>;
 				vsync-active = <1>;
 				pclk-sample = <0>;
@@ -590,8 +590,7 @@
 };
 
 &vin2a {
-	status = "okay";
-	endpoint@0 {
+	vin2a_ep: endpoint@0 {
 		slave-mode;
 		remote-endpoint = <&onboardLI>;
 	};

+ 22 - 30
arch/arm/boot/dts/dra74x.dtsi

@@ -114,29 +114,22 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
-			vin3a: port@0 {
+			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				reg = <0>;
-				status = "disabled";
-			};
-			vin4a: port@1 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <1>;
-				status = "disabled";
-			};
-			vin3b: port@2 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <2>;
-				status = "disabled";
-			};
-			vin4b: port@3 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <3>;
-				status = "disabled";
+
+				vin3a: port@0 {
+					reg = <0>;
+				};
+				vin4a: port@1 {
+					reg = <1>;
+				};
+				vin3b: port@2 {
+					reg = <2>;
+				};
+				vin4b: port@3 {
+					reg = <3>;
+				};
 			};
 		};
 
@@ -166,17 +159,16 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
-			vin5a: port@0 {
+			ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				reg = <0>;
-				status = "disabled";
-			};
-			vin6a: port@1 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <1>;
-				status = "disabled";
+
+				vin5a: port@0 {
+					reg = <0>;
+				};
+				vin6a: port@1 {
+					reg = <1>;
+				};
 			};
 		};
 	};

+ 2 - 3
arch/arm/boot/dts/dra76-evm.dts

@@ -335,7 +335,7 @@
 			    <&pcf_hdmi 6	GPIO_ACTIVE_LOW>; /* VIN2_S2 */
 		port {
 			onboardLI: endpoint {
-				remote-endpoint = <&vin2a>;
+				remote-endpoint = <&vin2a_ep>;
 				hsync-active = <1>;
 				vsync-active = <1>;
 				pclk-sample = <0>;
@@ -516,8 +516,7 @@
 };
 
 &vin2a {
-	status = "okay";
-	endpoint@0 {
+	vin2a_ep: endpoint@0 {
 		slave-mode;
 		remote-endpoint = <&onboardLI>;
 	};

+ 2 - 4
arch/arm/boot/dts/ti/mt9t111.dtso

@@ -23,7 +23,7 @@
 				input-clock-freq = <32000000>;
 				pclk-sample = <0>;
 				pixel-clock-freq = <96000000>;
-				remote-endpoint = <&vin3a>;
+				remote-endpoint = <&vin3a_ep>;
 				vsync-active = <0>;
 			};
 		};
@@ -31,9 +31,7 @@
 };
 
 &vin3a {
-	status = "okay";
-
-	endpoint {
+	vin3a_ep: endpoint {
 		remote-endpoint = <&cam>;
 		slave-mode;
 	};

+ 2 - 4
arch/arm/boot/dts/ti/ov10635.dtso

@@ -41,7 +41,7 @@
 			cam: endpoint {
 				hsync-active = <1>;
 				pclk-sample = <1>;
-				remote-endpoint = <&vin3a>;
+				remote-endpoint = <&vin3a_ep>;
 				vsync-active = <1>;
 			};
 		};
@@ -49,9 +49,7 @@
 };
 
 &vin3a {
-	status = "okay";
-
-	endpoint {
+	vin3a_ep: endpoint {
 		remote-endpoint = <&cam>;
 		slave-mode;
 	};

+ 5 - 4
drivers/media/i2c/mt9t11x.c

@@ -861,13 +861,15 @@ static unsigned int mt9t11x_pll_calc_params(struct mt9t11x_priv *priv)
 
 static int mt9t11x_sysctl_startup(const struct i2c_client *client)
 {
-	int ret = 0;
+	int ret;
 
 	/* reset */
-	mt9t11x_reset(client);
+	ret = mt9t11x_reset(client);
+	if (ret < 0)
+		return ret;
 
 	/* Setup PLL */
-	mt9t11x_pll_setup_pll(client);
+	ret = mt9t11x_pll_setup_pll(client);
 
 	return ret;
 }
@@ -2275,7 +2277,6 @@ MODULE_DEVICE_TABLE(of, mt9t11x_of_match);
 
 static struct i2c_driver mt9t11x_i2c_driver = {
 	.driver = {
-		.owner = THIS_MODULE,
 		.name	= DRIVER_NAME,
 		.of_match_table = of_match_ptr(mt9t11x_of_match),
 	},

+ 53 - 117
drivers/media/platform/ti-vpe/vip.c

@@ -308,7 +308,7 @@ inline struct vip_port *notifier_to_vip_port(struct v4l2_async_notifier *n)
 	return container_of(n, struct vip_port, notifier);
 }
 
-static bool __maybe_unused vip_is_fmt_yuv(u32 fourcc)
+static bool vip_is_fmt_yuv(u32 fourcc)
 {
 	if (fourcc == V4L2_PIX_FMT_NV12 ||
 	    fourcc == V4L2_PIX_FMT_UYVY ||
@@ -331,7 +331,7 @@ static bool vip_is_fmt_rgb(u32 fourcc)
 	return false;
 }
 
-static bool __maybe_unused vip_is_mbuscode_yuv(u32 code)
+static bool vip_is_mbuscode_yuv(u32 code)
 {
 	return ((code & 0xFF00) == 0x2000);
 }
@@ -3127,7 +3127,7 @@ static int vip_setup_parser(struct vip_port *port)
 	return 0;
 }
 
-static __maybe_unused void vip_enable_parser(struct vip_port *port, bool on)
+static void vip_enable_parser(struct vip_port *port, bool on)
 {
 	u32 config0;
 	struct vip_dev *dev = port->dev;
@@ -3145,7 +3145,7 @@ static __maybe_unused void vip_enable_parser(struct vip_port *port, bool on)
 	reg_write(parser, VIP_PARSER_PORT(port->port_id), config0);
 }
 
-static __maybe_unused void vip_reset_parser(struct vip_port *port, bool on)
+static void vip_reset_parser(struct vip_port *port, bool on)
 {
 	u32 config0;
 	struct vip_dev *dev = port->dev;
@@ -3161,7 +3161,7 @@ static __maybe_unused void vip_reset_parser(struct vip_port *port, bool on)
 	reg_write(parser, VIP_PARSER_PORT(port->port_id), config0);
 }
 
-static __maybe_unused void vip_parser_stop_imm(struct vip_port *port, bool on)
+static void vip_parser_stop_imm(struct vip_port *port, bool on)
 {
 	u32 config0;
 	struct vip_dev *dev = port->dev;
@@ -3507,6 +3507,9 @@ static int alloc_port(struct vip_dev *dev, int id)
 	struct vip_port *port;
 	u32 vin_id;
 
+	if (dev->ports[id])
+		return -EINVAL;
+
 	port = devm_kzalloc(&dev->pdev->dev, sizeof(*port), GFP_KERNEL);
 	if (!port)
 		return -ENOMEM;
@@ -3625,127 +3628,61 @@ static const struct v4l2_async_notifier_operations vip_async_ops = {
 	.complete = vip_async_complete,
 };
 
-static struct device_node *
-of_get_next_available_port(const struct device_node *parent,
-			   struct device_node *prev)
+static struct fwnode_handle *
+fwnode_graph_get_next_endpoint_by_regs(const struct fwnode_handle *fwnode,
+				       int port_reg, int reg)
 {
-	struct device_node *port = NULL;
-
-	if (!parent)
-		return NULL;
-
-	do {
-		port = of_get_next_available_child(parent, prev);
-		if (!port)
-			return NULL;
-
-		prev = port;
-	} while (of_node_cmp(port->name, "port") != 0);
-
-	return port;
-}
-
-static struct device_node *
-of_get_next_endpoint(const struct device_node *parent,
-		     struct device_node *prev)
-{
-	struct device_node *ep = NULL;
-
-	if (!parent)
-		return NULL;
-
-	do {
-		ep = of_get_next_child(parent, prev);
-		if (!ep)
-			return NULL;
-		prev = ep;
-	} while (of_node_cmp(ep->name, "endpoint") != 0);
-
-	return ep;
+	return of_fwnode_handle(of_graph_get_endpoint_by_regs(to_of_node(fwnode),
+							      port_reg, reg));
 }
 
 static int vip_register_subdev_notif(struct vip_port *port,
-				     struct device_node *port_node)
+				     struct fwnode_handle *ep)
 {
 	struct vip_async_config *config = &port->config;
 	struct v4l2_async_notifier *notifier = &port->notifier;
-	struct v4l2_async_subdev *asd;
 	struct vip_dev *dev = port->dev;
-	struct device_node *ep_node = NULL, *subdev_node, *subdev_ep;
-	int i = 0, ret;
-
-	while (i < VIP_MAX_SUBDEV) {
-		subdev_node = NULL;
-		subdev_ep = NULL;
-		ep_node = of_get_next_endpoint(port_node, ep_node);
-		if (!ep_node) {
-			vip_dbg(3, port, "can't get next endpoint: loop: %d\n",
-				i);
-			break;
-		}
-
-		subdev_node = of_graph_get_remote_port_parent(ep_node);
-		if (!subdev_node) {
-			vip_dbg(3, port, "can't get remote parent: loop: %d\n",
-				i);
-			goto of_node_cleanup;
-		}
-
-		subdev_ep = of_graph_get_remote_endpoint(ep_node);
-		if (!subdev_ep) {
-			vip_dbg(3, port, "can't get remote-endpoint: loop: %d\n",
-				i);
-			goto of_node_cleanup;
-		}
-
-		ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(subdev_ep),
-						 &config->endpoints[i]);
-		if (ret) {
-			vip_dbg(3, port, "Failed to parse endpoint: loop: %d\n",
-				i);
-			goto of_node_cleanup;
-		}
+	struct fwnode_handle *subdev, *remote_ep;
+	int ret;
 
-		asd = &config->asd[i];
-		asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
-		asd->match.fwnode = of_fwnode_handle(subdev_node);
-		config->asd_list[i] = asd;
-		i++;
+	subdev = fwnode_graph_get_remote_port_parent(ep);
+	if (!subdev) {
+		vip_dbg(3, port, "can't get remote parent\n");
+		return -EINVAL;
+	}
 
-of_node_cleanup:
-		if (!subdev_ep)
-			of_node_put(subdev_ep);
-		if (!subdev_node)
-			of_node_put(subdev_node);
+	remote_ep = fwnode_graph_get_remote_endpoint(ep);
+	if (!remote_ep) {
+		vip_dbg(3, port, "can't get remote-endpoint\n");
+		fwnode_handle_put(subdev);
+		return -EINVAL;
 	}
 
-	if (i == 0) {
-		vip_err(port, "Port %c enabled but no endpoints found\n",
-			port->port_id == VIP_PORTA ? 'A' : 'B');
-		ret = -EINVAL;
-		goto skip_async;
+	ret = v4l2_fwnode_endpoint_parse(remote_ep, &config->endpoints[0]);
+	if (ret) {
+		vip_dbg(3, port, "Failed to parse endpoint:\n");
+		fwnode_handle_put(subdev);
+		fwnode_handle_put(remote_ep);
+		return -EINVAL;
 	}
 
-	config->asd_sizes = i;
+	fwnode_handle_put(subdev);
+	fwnode_handle_put(remote_ep);
+
+	config->asd[0].match_type = V4L2_ASYNC_MATCH_FWNODE;
+	config->asd[0].match.fwnode = subdev;
+	config->asd_list[0] = &config->asd[0];
+	config->asd_sizes = 1;
 	notifier->ops = &vip_async_ops;
 	notifier->subdevs = config->asd_list;
 	notifier->num_subdevs = config->asd_sizes;
 
-	vip_dbg(1, port, "register async notifier for %d subdevs\n", i);
 	ret = v4l2_async_notifier_register(dev->v4l2_dev, notifier);
 	if (ret) {
 		vip_dbg(1, port, "Error registering async notifier\n");
 		ret = -EINVAL;
 	}
 
-skip_async:
-	if (!subdev_ep)
-		of_node_put(subdev_ep);
-	if (!subdev_node)
-		of_node_put(subdev_node);
-	if (!ep_node)
-		of_node_put(ep_node);
-
 	return ret;
 }
 
@@ -3756,11 +3693,9 @@ static int vip_of_probe(struct platform_device *pdev)
 	u32 syscon_pol_offset = 0;
 	struct vip_port *port;
 	struct vip_dev *dev;
-
 	struct device_node *parent = pdev->dev.of_node;
-	struct device_node *port_node = NULL;
-	int ret, slice_id, port_id;
-	u32 regval = 0;
+	struct fwnode_handle *ep = NULL;
+	int ret, slice_id, port_id, p;
 
 	if (parent && of_property_read_bool(parent, "syscon-pol")) {
 		syscon_pol = syscon_regmap_lookup_by_phandle(parent,
@@ -3777,14 +3712,13 @@ static int vip_of_probe(struct platform_device *pdev)
 		}
 	}
 
-	while (1) {
-		port_node = of_get_next_available_port(parent, port_node);
-		if (!port_node)
-			break;
+	for (p = 0; p < (VIP_NUM_PORTS * VIP_NUM_SLICES); p++) {
+		ep = fwnode_graph_get_next_endpoint_by_regs(of_fwnode_handle(parent),
+							    p, 0);
+		if (!ep)
+			continue;
 
-		/* Find the port from <REG> */
-		of_property_read_u32(port_node, "reg", &regval);
-		switch (regval) {
+		switch (p) {
 		case 0:
 			slice_id = VIP_SLICE1;	port_id = VIP_PORTA;
 			break;
@@ -3798,18 +3732,20 @@ static int vip_of_probe(struct platform_device *pdev)
 			slice_id = VIP_SLICE2;	port_id = VIP_PORTB;
 			break;
 		default:
-			dev_err(&pdev->dev, "Unknown port reg=<%d>\n", regval);
+			dev_err(&pdev->dev, "Unknown port reg=<%d>\n", p);
 			continue;
 		}
 
+		ret = alloc_port(shared->devs[slice_id], port_id);
+		if (ret < 0)
+			continue;
+
 		dev = shared->devs[slice_id];
 		dev->syscon_pol = syscon_pol;
 		dev->syscon_pol_offset = syscon_pol_offset;
-		alloc_port(dev, port_id);
 		port = dev->ports[port_id];
 
-		ret = vip_register_subdev_notif(port, port_node);
-		of_node_put(port_node);
+		vip_register_subdev_notif(port, ep);
 	}
 	return 0;
 }

+ 1 - 1
drivers/media/platform/ti-vpe/vpe.c

@@ -1148,7 +1148,7 @@ static void add_in_dtd(struct vpe_ctx *ctx, int port)
 		 * of TBT or BTB
 		 */
 		if (q_data->flags & Q_DATA_INTERLACED_SEQ_TB ||
-		    q_data->flags & Q_DATA_INTERLACED_SEQ_TB) {
+		    q_data->flags & Q_DATA_INTERLACED_SEQ_BT) {
 			/* Select initial value based on format */
 			if (q_data->flags & Q_DATA_INTERLACED_SEQ_BT)
 				field = 1;