From patchwork Tue Mar 18 11:13:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Wu X-Patchwork-Id: 3853131 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 624A0BF549 for ; Wed, 19 Mar 2014 17:42:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85C302017B for ; Wed, 19 Mar 2014 17:42:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F09C203B7 for ; Wed, 19 Mar 2014 17:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100AbaCRLUL (ORCPT ); Tue, 18 Mar 2014 07:20:11 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:10298 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754882AbaCRLUL (ORCPT ); Tue, 18 Mar 2014 07:20:11 -0400 Received: from apsmtp01.atmel.com (10.168.254.30) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.2.347.0; Tue, 18 Mar 2014 12:20:07 +0100 Received: from shaarm01.corp.atmel.com (10.168.254.13) by apsmtp01.corp.atmel.com (10.168.254.30) with Microsoft SMTP Server id 14.2.347.0; Tue, 18 Mar 2014 19:26:57 +0800 From: Josh Wu To: CC: , , , , Josh Wu Subject: [PATCH 2/3] [media] atmel-isi: convert the pdata from pointer to structure Date: Tue, 18 Mar 2014 19:13:58 +0800 Message-ID: <1395141238-5948-3-git-send-email-josh.wu@atmel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1395141238-5948-1-git-send-email-josh.wu@atmel.com> References: <1395141238-5948-1-git-send-email-josh.wu@atmel.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Now the platform data is initialized by allocation of isi structure. In the future, we use pdata to store the dt parameters. Signed-off-by: Josh Wu --- drivers/media/platform/soc_camera/atmel-isi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index d22aba1..93bf1cb 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c @@ -84,7 +84,7 @@ struct atmel_isi { struct clk *mck; unsigned int irq; - struct isi_platform_data *pdata; + struct isi_platform_data pdata; u16 width_flags; /* max 12 bits */ struct list_head video_buffer_list; @@ -350,7 +350,7 @@ static void start_dma(struct atmel_isi *isi, struct frame_buffer *buffer) cfg1 &= ~ISI_CFG1_FRATE_DIV_MASK; /* Enable linked list */ - cfg1 |= isi->pdata->frate | ISI_CFG1_DISCR; + cfg1 |= isi->pdata.frate | ISI_CFG1_DISCR; /* Enable codec path and ISI */ ctrl = ISI_CTRL_CDC | ISI_CTRL_EN; @@ -797,7 +797,7 @@ static int isi_camera_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 (isi->pdata->hsync_act_low) + if (isi->pdata.hsync_act_low) common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_HIGH; else common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_LOW; @@ -805,7 +805,7 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) && (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) { - if (isi->pdata->vsync_act_low) + if (isi->pdata.vsync_act_low) common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH; else common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW; @@ -813,7 +813,7 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) if ((common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) && (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)) { - if (isi->pdata->pclk_act_falling) + if (isi->pdata.pclk_act_falling) common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_RISING; else common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_FALLING; @@ -835,9 +835,9 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING; - if (isi->pdata->has_emb_sync) + if (isi->pdata.has_emb_sync) cfg1 |= ISI_CFG1_EMB_SYNC; - if (isi->pdata->full_mode) + if (isi->pdata.full_mode) cfg1 |= ISI_CFG1_FULL_MODE; isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); @@ -905,7 +905,7 @@ static int atmel_isi_probe(struct platform_device *pdev) if (IS_ERR(isi->pclk)) return PTR_ERR(isi->pclk); - isi->pdata = pdata; + memcpy(&isi->pdata, pdata, sizeof(struct isi_platform_data)); isi->active = NULL; spin_lock_init(&isi->lock); INIT_LIST_HEAD(&isi->video_buffer_list); @@ -921,7 +921,7 @@ static int atmel_isi_probe(struct platform_device *pdev) /* Set ISI_MCK's frequency, it should be faster than pixel * clock. */ - ret = clk_set_rate(isi->mck, pdata->mck_hz); + ret = clk_set_rate(isi->mck, isi->pdata.mck_hz); if (ret < 0) return ret; } @@ -955,9 +955,9 @@ static int atmel_isi_probe(struct platform_device *pdev) goto err_ioremap; } - if (pdata->data_width_flags & ISI_DATAWIDTH_8) + if (isi->pdata.data_width_flags & ISI_DATAWIDTH_8) isi->width_flags = 1 << 7; - if (pdata->data_width_flags & ISI_DATAWIDTH_10) + if (isi->pdata.data_width_flags & ISI_DATAWIDTH_10) isi->width_flags |= 1 << 9; isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);