gpu: ipu-v3: drop unused dmfc field from client platform data
Subsystems (5)
Philipp Zabel
maintainerPATCH 1/4 gpu: ipu-v3: drop unused dmfc field from client platform data
This field is never used, drop it.
--- include/video/imx-ipu-v3.h | 1 - 1 file changed, 1 deletion(-)
include/video/imx-ipu-v3.h +0 -1
@@ -343,7 +343,6 @@ struct ipu_client_platformdata {int di;int dc;int dp; -int dmfc;int dma[2 ]; };
Signature · 6 lines
2.6.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 2/4 gpu: ipu-v3: Remove reg_offset field
This is not used, so remove it.
--- drivers/gpu/ipu-v3/ipu-common.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-)
drivers/gpu/ipu-v3/ipu-common.c +3 -16
@@ -993,7 +993,6 @@ static void platform_device_unregister_children(struct platform_device *pdev)struct ipu_platform_reg {struct ipu_client_platformdata pdata;const char *name; -int reg_offset; };static const struct ipu_platform_reg client_reg[] = {
@@ -1021,7 +1020,6 @@ static const struct ipu_platform_reg client_reg[] = { .dma[0] = IPUV3_CHANNEL_CSI0, .dma[1] = -EINVAL, }, - .reg_offset = IPU_CM_CSI0_REG_OFS, .name = "imx-ipuv3-camera", }, { .pdata = {
@@ -1029,7 +1027,6 @@ static const struct ipu_platform_reg client_reg[] = { .dma[0] = IPUV3_CHANNEL_CSI1, .dma[1] = -EINVAL, }, - .reg_offset = IPU_CM_CSI1_REG_OFS, .name = "imx-ipuv3-camera", }, };
@@ -1051,19 +1048,9 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)for (i =0 ; i <ARRAY_SIZE (client_reg); i++) {const struct ipu_platform_reg *reg = &client_reg[i];struct platform_device *pdev; -struct resource res; - -if (reg->reg_offset) { -memset (&res,0 ,sizeof (res)); - res.flags =IORESOURCE_MEM ; - res.start = ipu_base + ipu->devtype->cm_ofs + reg->reg_offset; - res.end = res.start +PAGE_SIZE -1 ; - pdev =platform_device_register_resndata (dev, reg->name, - id++, &res,1 , ®->pdata,sizeof (reg->pdata)); - }else { - pdev =platform_device_register_data (dev, reg->name, - id++, ®->pdata,sizeof (reg->pdata)); - } + + pdev =platform_device_register_data (dev, reg->name, + id++, ®->pdata,sizeof (reg->pdata));if (IS_ERR (pdev)) { ret =PTR_ERR (pdev);
Signature · 6 lines
2.6.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 3/4 gpu: ipu-v3: Assign of_node of child platform devices to corresponding ports
In reply to Philipp ZabelThe crtc child device driver shouldn't have to modify the of_node of its platform device in the probe function. Instead, let the IPU core driver set the of_node when the platform device is created.
Also reorder the client_reg array so the elements are in port id order (CSIs first, then DIs).
--- drivers/gpu/ipu-v3/ipu-common.c | 56 ++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 18 deletions(-)
drivers/gpu/ipu-v3/ipu-common.c +38 -18
@@ -28,6 +28,7 @@#include <linux/irqchip/chained_irq.h> #include <linux/irqdomain.h> #include <linux/of_device.h> +#include <linux/of_graph.h> #include <drm/drm_fourcc.h>
@@ -995,9 +996,24 @@ struct ipu_platform_reg {const char *name; }; +/* These must be in the order of the corresponding device tree port nodes */ static const struct ipu_platform_reg client_reg[] = { { .pdata = { + .csi =0 , + .dma[0 ] =IPUV3_CHANNEL_CSI0 , + .dma[1 ] = -EINVAL , + }, + .name ="imx-ipuv3-camera" , + }, { + .pdata = { + .csi =1 , + .dma[0 ] =IPUV3_CHANNEL_CSI1 , + .dma[1 ] = -EINVAL , + }, + .name ="imx-ipuv3-camera" , + }, { + .pdata = { .di =0 , .dc =5 , .dp =IPU_DP_FLOW_SYNC_BG ,
@@ -1014,20 +1030,6 @@ static const struct ipu_platform_reg client_reg[] = { .dma[1] = -EINVAL, }, .name = "imx-ipuv3-crtc", - }, { - .pdata = { - .csi = 0, - .dma[0] = IPUV3_CHANNEL_CSI0, - .dma[1] = -EINVAL, - }, - .name = "imx-ipuv3-camera", - }, { - .pdata = { - .csi = 1, - .dma[0] = IPUV3_CHANNEL_CSI1, - .dma[1] = -EINVAL, - }, - .name = "imx-ipuv3-camera", }, };
@@ -1049,11 +1051,29 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)const struct ipu_platform_reg *reg = &client_reg[i];struct platform_device *pdev; - pdev =platform_device_register_data (dev, reg->name, - id++, ®->pdata,sizeof (reg->pdata)); + pdev =platform_device_alloc (reg->name, id++); +if (!pdev) { + ret = -ENOMEM ; + goto err_register; + } + + pdev->dev.parent = dev; + +/* Associate subdevice with the corresponding port node */ + pdev->dev.of_node =of_graph_get_port_by_id (dev->of_node, i); +if (!pdev->dev.of_node) { +dev_err (dev,"missing port@%d node in %s\n" , i, + dev->of_node->full_name); + ret = -ENODEV ; + goto err_register; + } -if (IS_ERR (pdev)) { - ret =PTR_ERR (pdev); + ret =platform_device_add_data (pdev, ®->pdata, +sizeof (reg->pdata)); +if (!ret) + ret =platform_device_add (pdev); +if (ret) { +platform_device_put (pdev); goto err_register; } }
Signature · 6 lines
2.6.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 4/4 drm/imx: Remove of_node assignment from ipuv3-crtc driver probe
In reply to Philipp ZabelThe crtc child device driver shouldn't modify the of_node of its platform device in the probe function. Instead, since the previous patch, the IPU core driver sets the of_node when the platform device is created.
Drop the now unused custom imx_drm_get_port_by_id function.
--- drivers/gpu/drm/imx/ipuv3-crtc.c | 34 ---------------------------------- 1 file changed, 34 deletions(-)
drivers/gpu/drm/imx/ipuv3-crtc.c +0 -34
@@ -411,28 +411,6 @@ err_put_resources:return ret; } -static struct device_node *ipu_drm_get_port_by_id (struct device_node *parent, -int port_id) -{ -struct device_node *port; -int id, ret; - - port =of_get_child_by_name (parent,"port" ); -while (port) { - ret =of_property_read_u32 (port,"reg" , &id); -if (!ret && id == port_id) -return port; - -do { - port =of_get_next_child (parent, port); -if (!port) -return NULL ; - }while (of_node_cmp (port->name,"port" )); - } - -return NULL ; -} -static int ipu_drm_bind (struct device *dev,struct device *master,void *data) {struct ipu_client_platformdata *pdata = dev->platform_data;
@@ -474,23 +452,11 @@ static const struct component_ops ipu_crtc_ops = {static int ipu_drm_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct ipu_client_platformdata *pdata = dev->platform_data;int ret;if (!dev->platform_data)return -EINVAL ; -if (!dev->of_node) { -/* Associate crtc device with the corresponding DI port node */ - dev->of_node =ipu_drm_get_port_by_id (dev->parent->of_node, - pdata->di +2 ); -if (!dev->of_node) { -dev_err (dev,"missing port@%d node in %s\n" , - pdata->di +2 , dev->parent->of_node->full_name); -return -ENODEV ; - } - } - ret =dma_set_coherent_mask (dev,DMA_BIT_MASK (32 ));if (ret)return ret;
Signature · 6 lines
2.6.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 4/4] drm/imx: Remove of_node assignment from ipuv3-crtc driver probe
Quoted 8 lines · Philipp Zabel
The crtc child device driver shouldn't modify the
of_nodeof its platform device in the probe function. Instead, since the previous patch, the IPU core driver sets theof_nodewhen the platform device is created.Drop the now unused custom
imx_drm_get_port_by_idfunction.Signed-off-by Philipp Zabel <[email protected]>Suggested-by Russell King <[email protected]>
Yay, many thanks for this, Philipp! For patches 3 and 4:
(Please change to use rmk+kernel in both Suggested-by lines as well.)
I haven't moved my development tree forward yet (no -rc1) but when I do, I'll look at what my remaining patch situation is like. I'd hope that this merge window has seen my patch stack reduce down to something more reasonable.
Signature · 6 lines
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel