From patchwork Fri Oct 16 19:09:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 54391 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9GJK0WJ013190 for ; Fri, 16 Oct 2009 19:20:00 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9GJHgbE021504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Oct 2009 14:17:43 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9GJHgLv022839; Fri, 16 Oct 2009 14:17:42 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4D9E580791; Fri, 16 Oct 2009 14:16:20 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 8158B8063B for ; Fri, 16 Oct 2009 14:12:53 -0500 (CDT) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9GJCrdg013975 for ; Fri, 16 Oct 2009 14:12:53 -0500 (CDT) Received: from mail35-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.111]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9GJCp6n003062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 16 Oct 2009 14:12:52 -0500 Received: from mail35-va3 (localhost.localdomain [127.0.0.1]) by mail35-va3-R.bigfish.com (Postfix) with ESMTP id 86C7ED28638 for ; Fri, 16 Oct 2009 19:12:51 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zza4b1ozz1202hzzz2dh6bh61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.219.220; Service: EHS Received: by mail35-va3 (MessageSwitch) id 1255720364190111_27901; Fri, 16 Oct 2009 19:12:44 +0000 (UCT) Received: from VA3EHSMHS015.bigfish.com (unknown [10.7.14.252]) by mail35-va3.bigfish.com (Postfix) with ESMTP id D81C9162809E for ; Fri, 16 Oct 2009 19:12:21 +0000 (UTC) Received: from mail-ew0-f220.google.com (209.85.219.220) by VA3EHSMHS015.bigfish.com (10.7.99.25) with Microsoft SMTP Server id 14.0.482.32; Fri, 16 Oct 2009 19:12:20 +0000 Received: by mail-ew0-f220.google.com with SMTP id 20so2500484ewy.40 for ; Fri, 16 Oct 2009 12:12:19 -0700 (PDT) Received: by 10.216.86.137 with SMTP id w9mr725979wee.104.1255720339409; Fri, 16 Oct 2009 12:12:19 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id i6sm3127443gve.2.2009.10.16.12.12.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Oct 2009 12:12:18 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.infradead.org Date: Fri, 16 Oct 2009 12:09:30 -0700 Message-ID: <1255720190-7452-28-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.4.3 In-Reply-To: <1255720190-7452-27-git-send-email-khilman@deeprootsystems.com> References: <1255720190-7452-1-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-2-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-3-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-4-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-5-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-6-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-7-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-8-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-9-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-10-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-11-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-12-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-13-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-14-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-15-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-16-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-17-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-18-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-19-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-20-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-21-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-22-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-23-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-24-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-25-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-26-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-27-git-send-email-khilman@deeprootsystems.com> MIME-Version: 1.0 X-Reverse-DNS: mail-ew0-f220.google.com Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 26/46] DaVinci: EDMA: Updating terminlogy in EDMA driver X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c index b097592..4ff1f93 100644 --- a/arch/arm/mach-davinci/dma.c +++ b/arch/arm/mach-davinci/dma.c @@ -509,21 +509,21 @@ static irqreturn_t dma_tc1err_handler(int irq, void *data) return IRQ_HANDLED; } -static int reserve_contiguous_params(int ctlr, unsigned int id, - unsigned int num_params, - unsigned int start_param) +static int reserve_contiguous_slots(int ctlr, unsigned int id, + unsigned int num_slots, + unsigned int start_slot) { int i, j; - unsigned int count = num_params; - int stop_param = start_param; + unsigned int count = num_slots; + int stop_slot = start_slot; DECLARE_BITMAP(tmp_inuse, EDMA_MAX_PARAMENTRY); - for (i = start_param; i < edma_info[ctlr]->num_slots; ++i) { + for (i = start_slot; i < edma_info[ctlr]->num_slots; ++i) { j = EDMA_CHAN_SLOT(i); if (!test_and_set_bit(j, edma_info[ctlr]->edma_inuse)) { /* Record our current beginning slot */ - if (count == num_params) - stop_param = i; + if (count == num_slots) + stop_slot = i; count--; set_bit(j, tmp_inuse); @@ -534,34 +534,34 @@ static int reserve_contiguous_params(int ctlr, unsigned int id, clear_bit(j, tmp_inuse); if (id == EDMA_CONT_PARAMS_FIXED_EXACT) { - stop_param = i; + stop_slot = i; break; } else - count = num_params; + count = num_slots; } } /* * We have to clear any bits that we set - * if we run out parameter RAMs, i.e we do find a set - * of contiguous parameter RAMs but do not find the exact number - * requested as we may reach the total number of parameter RAMs + * if we run out parameter RAM slots, i.e we do find a set + * of contiguous parameter RAM slots but do not find the exact number + * requested as we may reach the total number of parameter RAM slots */ if (i == edma_info[ctlr]->num_slots) - stop_param = i; + stop_slot = i; - for (j = start_param; j < stop_param; j++) + for (j = start_slot; j < stop_slot; j++) if (test_bit(j, tmp_inuse)) clear_bit(j, edma_info[ctlr]->edma_inuse); if (count) return -EBUSY; - for (j = i - num_params + 1; j <= i; ++j) + for (j = i - num_slots + 1; j <= i; ++j) memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(j), &dummy_paramset, PARM_SIZE); - return EDMA_CTLR_CHAN(ctlr, i - num_params + 1); + return EDMA_CTLR_CHAN(ctlr, i - num_slots + 1); } /*-----------------------------------------------------------------------*/ @@ -759,26 +759,27 @@ EXPORT_SYMBOL(edma_free_slot); /** * edma_alloc_cont_slots- alloc contiguous parameter RAM slots * The API will return the starting point of a set of - * contiguous PARAM's that have been requested + * contiguous parameter RAM slots that have been requested * * @id: can only be EDMA_CONT_PARAMS_ANY or EDMA_CONT_PARAMS_FIXED_EXACT * or EDMA_CONT_PARAMS_FIXED_NOT_EXACT - * @count: number of contiguous Paramter RAM's - * @param - the start value of Parameter RAM that should be passed if id + * @count: number of contiguous Paramter RAM slots + * @slot - the start value of Parameter RAM slot that should be passed if id * is EDMA_CONT_PARAMS_FIXED_EXACT or EDMA_CONT_PARAMS_FIXED_NOT_EXACT * * If id is EDMA_CONT_PARAMS_ANY then the API starts looking for a set of - * contiguous Parameter RAMs from parameter RAM 64 in the case of DaVinci SOCs - * and 32 in the case of Primus + * contiguous Parameter RAM slots from parameter RAM 64 in the case of + * DaVinci SOCs and 32 in the case of DA8xx SOCs. * * If id is EDMA_CONT_PARAMS_FIXED_EXACT then the API starts looking for a - * set of contiguous parameter RAMs from the "param" that is passed as an + * set of contiguous parameter RAM slots from the "slot" that is passed as an * argument to the API. * * If id is EDMA_CONT_PARAMS_FIXED_NOT_EXACT then the API initially tries - * starts looking for a set of contiguous parameter RAMs from the "param" + * starts looking for a set of contiguous parameter RAMs from the "slot" * that is passed as an argument to the API. On failure the API will try to - * find a set of contiguous Parameter RAMs in the remaining Parameter RAMs + * find a set of contiguous Parameter RAM slots from the remaining Parameter + * RAM slots */ int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count) { @@ -793,7 +794,7 @@ int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count) return -EINVAL; /* - * The number of parameter RAMs requested cannot be less than 1 + * The number of parameter RAM slots requested cannot be less than 1 * and cannot be more than the number of slots minus the number of * channels */ @@ -803,11 +804,11 @@ int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count) switch (id) { case EDMA_CONT_PARAMS_ANY: - return reserve_contiguous_params(ctlr, id, count, + return reserve_contiguous_slots(ctlr, id, count, edma_info[ctlr]->num_channels); case EDMA_CONT_PARAMS_FIXED_EXACT: case EDMA_CONT_PARAMS_FIXED_NOT_EXACT: - return reserve_contiguous_params(ctlr, id, count, slot); + return reserve_contiguous_slots(ctlr, id, count, slot); default: return -EINVAL; } @@ -816,14 +817,14 @@ int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count) EXPORT_SYMBOL(edma_alloc_cont_slots); /** - * edma_free_cont_slots - deallocate DMA parameter RAMs - * @slot: first parameter RAM of a set of parameter RAMs to be freed - * @count: the number of contiguous parameter RAMs to be freed + * edma_free_cont_slots - deallocate DMA parameter RAM slots + * @slot: first parameter RAM of a set of parameter RAM slots to be freed + * @count: the number of contiguous parameter RAM slots to be freed * * This deallocates the parameter RAM slots allocated by * edma_alloc_cont_slots. * Callers/applications need to keep track of sets of contiguous - * parameter RAMs that have been allocated using the edma_alloc_cont_slots + * parameter RAM slots that have been allocated using the edma_alloc_cont_slots * API. * Callers are responsible for ensuring the slots are inactive, and will * not be activated.