From patchwork Sat Jun 7 21:56:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 4316091 Return-Path: X-Original-To: patchwork-linux-media@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 BDCB99F170 for ; Sat, 7 Jun 2014 21:57:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E687C20225 for ; Sat, 7 Jun 2014 21:57:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0AB2E20222 for ; Sat, 7 Jun 2014 21:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753345AbaFGV5R (ORCPT ); Sat, 7 Jun 2014 17:57:17 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:43414 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbaFGV5P (ORCPT ); Sat, 7 Jun 2014 17:57:15 -0400 Received: by mail-pb0-f50.google.com with SMTP id ma3so3885192pbc.37 for ; Sat, 07 Jun 2014 14:57:14 -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=3kposmQEpwzYAISMyRwaHFXz1vKIxea9w3pu+1stjK8=; b=hV0MAZS2Pl9bHEBZfIyowwtDMDKyrElCXrhQrGTcnr25Y00vid7x3LMvMtrE0UAxPF zVkRDgX8BpYqdnzgbJcg6iMIM7e/wQd9Dnlg0zG6Kwpj/L30lLyWxhCTyV2cZGctDlH/ Jn2NMgeqFLniQhz23RtgPsG5Dozxo8PhDAy+KhKj5rPNeI29h+5EuxqM9qSgR3VMRAZ3 LRtOtEEf842JAJXQcNdNiEcLsX0ZkN8/NWxluCu1UyQnsyXXpqMHN5TZoazRZxpTeL/J RjJbwqESZKg6TKDBqS9NAtqvo06+CyEiZpCiJMPDBt25Pzgv9AMYkq5HJVrce1igrxkW 2D+g== X-Received: by 10.68.102.34 with SMTP id fl2mr15725486pbb.2.1402178234440; Sat, 07 Jun 2014 14:57:14 -0700 (PDT) Received: from slongerb-fremont-linux.mgc.mentorg.com (c-98-248-118-71.hsd1.ca.comcast.net. [98.248.118.71]) by mx.google.com with ESMTPSA id fx5sm52769595pbb.62.2014.06.07.14.57.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Jun 2014 14:57:14 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 14/43] imx-drm: ipu-v3: Add ipu_idmac_clear_buffer() Date: Sat, 7 Jun 2014 14:56:16 -0700 Message-Id: <1402178205-22697-15-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402178205-22697-1-git-send-email-steve_longerbeam@mentor.com> References: <1402178205-22697-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Add the reverse of ipu_idmac_select_buffer(), that is, clear a buffer ready status in a channel. Signed-off-by: Steve Longerbeam --- drivers/staging/imx-drm/ipu-v3/ipu-common.c | 28 +++++++++++++++++++++++++++ include/linux/platform_data/imx-ipu-v3.h | 1 + 2 files changed, 29 insertions(+) diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-common.c b/drivers/staging/imx-drm/ipu-v3/ipu-common.c index 3ff55da..fd15eae 100644 --- a/drivers/staging/imx-drm/ipu-v3/ipu-common.c +++ b/drivers/staging/imx-drm/ipu-v3/ipu-common.c @@ -798,6 +798,34 @@ void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num) } EXPORT_SYMBOL_GPL(ipu_idmac_select_buffer); +void ipu_idmac_clear_buffer(struct ipuv3_channel *channel, u32 buf_num) +{ + struct ipu_soc *ipu = channel->ipu; + unsigned int chno = channel->num; + unsigned long flags; + + spin_lock_irqsave(&ipu->lock, flags); + + ipu_cm_write(ipu, 0xF0300000, IPU_GPR); /* write one to clear */ + switch (buf_num) { + case 0: + ipu_cm_write(ipu, idma_mask(chno), IPU_CHA_BUF0_RDY(chno)); + break; + case 1: + ipu_cm_write(ipu, idma_mask(chno), IPU_CHA_BUF1_RDY(chno)); + break; + case 2: + ipu_cm_write(ipu, idma_mask(chno), IPU_CHA_BUF2_RDY(chno)); + break; + default: + break; + } + ipu_cm_write(ipu, 0x0, IPU_GPR); /* write one to set */ + + spin_unlock_irqrestore(&ipu->lock, flags); +} +EXPORT_SYMBOL_GPL(ipu_idmac_clear_buffer); + int ipu_idmac_enable_channel(struct ipuv3_channel *channel) { struct ipu_soc *ipu = channel->ipu; diff --git a/include/linux/platform_data/imx-ipu-v3.h b/include/linux/platform_data/imx-ipu-v3.h index 0128667..480c30d 100644 --- a/include/linux/platform_data/imx-ipu-v3.h +++ b/include/linux/platform_data/imx-ipu-v3.h @@ -199,6 +199,7 @@ int ipu_idmac_wait_busy(struct ipuv3_channel *channel, int ms); void ipu_idmac_set_double_buffer(struct ipuv3_channel *channel, bool doublebuffer); void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num); +void ipu_idmac_clear_buffer(struct ipuv3_channel *channel, u32 buf_num); bool ipu_idmac_buffer_is_ready(struct ipuv3_channel *channel, u32 buf_num); /*