From patchwork Fri Jul 26 09:32:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katsuya Matsubara X-Patchwork-Id: 2833938 Return-Path: X-Original-To: patchwork-linux-sh@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 36B489F4D4 for ; Fri, 26 Jul 2013 09:33:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F2EF20119 for ; Fri, 26 Jul 2013 09:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2129520122 for ; Fri, 26 Jul 2013 09:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758420Ab3GZJdA (ORCPT ); Fri, 26 Jul 2013 05:33:00 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:57357 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758415Ab3GZJc7 (ORCPT ); Fri, 26 Jul 2013 05:32:59 -0400 Received: by mail-pb0-f50.google.com with SMTP id wz7so1811513pbc.23 for ; Fri, 26 Jul 2013 02:32:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=f/7035uPb688p+64zze4HOtwlsMMtNiZqhuTa4wZw54=; b=Ld2eHGWEsPo+7gsTO07c8xh9U7zunYiEwVKtmRmQ5nu7o0eclgD5dzb9MFhg8Ei52S RTgqHlXjo9mmJ5fHr+DAYTlJotdtMCizyqllxHej/5rpm4IaDslwFXXndwUI3/dZ8WB8 Q1UlRk8qbM++U5LFxdRVTwltXL+I7b5y1Fb3OkgbyETrYHx2skzuO2XQBWe7e3ycRiHT NQ5bwm/6zw5eXPTac0xHg7iB/uCEadApUKqO/q+HH0n9aXBID8+udTbjbbSJS8XLsItl 8vsXDrnIgpoUNHAHb+FiAaWKg85YQhcYNh9qJ6dVwnuVeyWYSOl000NgTvL+aj7KMZAP fs7Q== X-Received: by 10.68.247.226 with SMTP id yh2mr52047659pbc.164.1374831178495; Fri, 26 Jul 2013 02:32:58 -0700 (PDT) Received: from kiefer.hq.igel.co.jp ([219.106.231.132]) by mx.google.com with ESMTPSA id ot4sm2578248pac.17.2013.07.26.02.32.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 02:32:57 -0700 (PDT) From: Katsuya Matsubara To: Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-sh@vger.kernel.org, Hans Verkuil , Sakari Ailus , Sylwester Nawrocki , Katsuya Matsubara Subject: [PATCH 2/7] [media] vsp1: Use the maximum number defined in platform data Date: Fri, 26 Jul 2013 18:32:12 +0900 Message-Id: <1374831137-9219-3-git-send-email-matsu@igel.co.jp> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374831137-9219-1-git-send-email-matsu@igel.co.jp> References: <1374831137-9219-1-git-send-email-matsu@igel.co.jp> X-Gm-Message-State: ALoCoQlsojyrH9DIPVCrUgNbwfUXjDuIXwiSawsSlPKoEMuV1D0cJvrz60DRO+52q+hsXXXrI96Q Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 VSP1 driver allows to define the maximum number of each module such as RPF, WPF, and UDS in a platform data definition. This suppresses operations for nonexistent or unused modules. Signed-off-by: Katsuya Matsubara --- drivers/media/platform/vsp1/vsp1_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c index 0ead308..a8c21f8 100644 --- a/drivers/media/platform/vsp1/vsp1_drv.c +++ b/drivers/media/platform/vsp1/vsp1_drv.c @@ -35,7 +35,7 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data) irqreturn_t ret = IRQ_NONE; unsigned int i; - for (i = 0; i < VPS1_MAX_WPF; ++i) { + for (i = 0; i < vsp1->pdata->wpf_count; ++i) { struct vsp1_rwpf *wpf = vsp1->wpf[i]; struct vsp1_pipeline *pipe; u32 status; @@ -243,7 +243,7 @@ static void vsp1_device_init(struct vsp1_device *vsp1) /* Reset any channel that might be running. */ status = vsp1_read(vsp1, VI6_STATUS); - for (i = 0; i < VPS1_MAX_WPF; ++i) { + for (i = 0; i < vsp1->pdata->wpf_count; ++i) { unsigned int timeout; if (!(status & VI6_STATUS_SYS_ACT(i))) @@ -265,10 +265,10 @@ static void vsp1_device_init(struct vsp1_device *vsp1) vsp1_write(vsp1, VI6_CLK_DCSWT, (8 << VI6_CLK_DCSWT_CSTPW_SHIFT) | (8 << VI6_CLK_DCSWT_CSTRW_SHIFT)); - for (i = 0; i < VPS1_MAX_RPF; ++i) + for (i = 0; i < vsp1->pdata->rpf_count; ++i) vsp1_write(vsp1, VI6_DPR_RPF_ROUTE(i), VI6_DPR_NODE_UNUSED); - for (i = 0; i < VPS1_MAX_UDS; ++i) + for (i = 0; i < vsp1->pdata->uds_count; ++i) vsp1_write(vsp1, VI6_DPR_UDS_ROUTE(i), VI6_DPR_NODE_UNUSED); vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED);