From patchwork Fri Oct 31 22:54:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207281 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B614E9FBAB for ; Fri, 31 Oct 2014 23:56:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B78C920120 for ; Fri, 31 Oct 2014 23:56:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B269320160 for ; Fri, 31 Oct 2014 23:56:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B99D26E84E; Fri, 31 Oct 2014 16:56:38 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 39C1F6E84A for ; Fri, 31 Oct 2014 15:57:13 -0700 (PDT) Received: by mail-pa0-f50.google.com with SMTP id eu11so8582785pac.37 for ; Fri, 31 Oct 2014 15:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tcqHzcPQEnIHbhde8uwyFoVEYmoC8k5r8NYx6I7pQ2Q=; b=DmdztzV0rTpb9lPSFhPIc3QQTvGjbvLFnwAH4DW9md9IY0u7pgVVKfv3UzN79BoiA9 M3CQgGUolf1WaXYIDrMgwkmoSbQU5Evx2S1D/e04jQeQTqaVPxgwEtiU1jLtBMtSFWBI aYFaAJZAphW0uTKyJR2IU1Oi3PBBYYlm1jo/69+KX2zlbnZOaPAuDSzCK4LTvm9dknuM IBucfURoHR0pO6eiY/LNlss/sPoRaF+gZs0ltwr8ry/n7O/p/706Y0NtAlX1f0M1R4rI BrsRX38EiM0MKey219+sEtjGyYe53Uw858+4wcfEXBFZqnDD5qxnyslDgz6RJ3AKY3sY Ajmw== X-Received: by 10.70.34.100 with SMTP id y4mr27985309pdi.26.1414796233034; Fri, 31 Oct 2014 15:57:13 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:12 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 30/72] gpu: ipu-v3: Remove IPU client registration Date: Fri, 31 Oct 2014 15:54:13 -0700 Message-Id: <1414796095-10107-31-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:31 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The IPU client devices have been moved to the device tree, so remove platform registration of those devices. As a result, platform data (struct ipu_client_platformdata) is no longer needed, the client data is retrieved from the device nodes. Signed-off-by: Steve Longerbeam --- drivers/gpu/ipu-v3/ipu-common.c | 114 --------------------------------------- include/video/imx-ipu-v3.h | 9 ---- 2 files changed, 123 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 5004f71..ebafcf2 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -990,110 +990,6 @@ static void ipu_submodules_exit(struct ipu_soc *ipu) ipu_cpmem_exit(ipu); } -static int platform_remove_devices_fn(struct device *dev, void *unused) -{ - struct platform_device *pdev = to_platform_device(dev); - - platform_device_unregister(pdev); - - return 0; -} - -static void platform_device_unregister_children(struct platform_device *pdev) -{ - device_for_each_child(&pdev->dev, NULL, platform_remove_devices_fn); -} - -struct ipu_platform_reg { - struct ipu_client_platformdata pdata; - const char *name; - int reg_offset; -}; - -static const struct ipu_platform_reg client_reg[] = { - { - .pdata = { - .di = 0, - .dc = 5, - .dp = IPU_DP_FLOW_SYNC_BG, - .dma[0] = IPUV3_CHANNEL_MEM_BG_SYNC, - .dma[1] = IPUV3_CHANNEL_MEM_FG_SYNC, - }, - .name = "imx-ipuv3-crtc", - }, { - .pdata = { - .di = 1, - .dc = 1, - .dp = -EINVAL, - .dma[0] = IPUV3_CHANNEL_MEM_DC_SYNC, - .dma[1] = -EINVAL, - }, - .name = "imx-ipuv3-crtc", - }, { - .pdata = { - .csi = 0, - .dma[0] = IPUV3_CHANNEL_CSI0, - .dma[1] = -EINVAL, - }, - .reg_offset = IPU_CM_CSI0_REG_OFS, - .name = "imx-ipuv3-camera", - }, { - .pdata = { - .csi = 1, - .dma[0] = IPUV3_CHANNEL_CSI1, - .dma[1] = -EINVAL, - }, - .reg_offset = IPU_CM_CSI1_REG_OFS, - .name = "imx-ipuv3-camera", - }, -}; - -static DEFINE_MUTEX(ipu_client_id_mutex); -static int ipu_client_id; - -static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base) -{ - struct device *dev = ipu->dev; - unsigned i; - int id, ret; - - mutex_lock(&ipu_client_id_mutex); - id = ipu_client_id; - ipu_client_id += ARRAY_SIZE(client_reg); - mutex_unlock(&ipu_client_id_mutex); - - 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)); - } - - if (IS_ERR(pdev)) { - ret = PTR_ERR(pdev); - goto err_register; - } - } - - return 0; - -err_register: - platform_device_unregister_children(to_platform_device(dev)); - - return ret; -} - - static int ipu_irq_init(struct ipu_soc *ipu) { struct irq_chip_generic *gc; @@ -1318,19 +1214,10 @@ static int ipu_probe(struct platform_device *pdev) if (ret) goto failed_submodules_init; - ret = ipu_add_client_devices(ipu, ipu_base); - if (ret) { - dev_err(&pdev->dev, "adding client devices failed with %d\n", - ret); - goto failed_add_clients; - } - dev_info(&pdev->dev, "%s probed\n", devtype->name); return 0; -failed_add_clients: - ipu_submodules_exit(ipu); failed_submodules_init: out_failed_reset: ipu_irq_exit(ipu); @@ -1343,7 +1230,6 @@ static int ipu_remove(struct platform_device *pdev) { struct ipu_soc *ipu = platform_get_drvdata(pdev); - platform_device_unregister_children(pdev); ipu_submodules_exit(ipu); ipu_irq_exit(ipu); diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 7e1bc61..7ff0d99 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -385,13 +385,4 @@ int ipu_degrees_to_rot_mode(enum ipu_rotate_mode *mode, int degrees, int ipu_rot_mode_to_degrees(int *degrees, enum ipu_rotate_mode mode, bool hflip, bool vflip); -struct ipu_client_platformdata { - int csi; - int di; - int dc; - int dp; - int dmfc; - int dma[2]; -}; - #endif /* __DRM_IPU_H__ */