From patchwork Thu Jan 12 22:26:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Bostic X-Patchwork-Id: 9514311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B581260476 for ; Thu, 12 Jan 2017 22:26:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBCB62871C for ; Thu, 12 Jan 2017 22:26:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B05B828720; Thu, 12 Jan 2017 22:26:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 455822871C for ; Thu, 12 Jan 2017 22:26:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRnpf-00042x-40; Thu, 12 Jan 2017 22:26:55 +0000 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRnpb-0003z9-5T for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2017 22:26:52 +0000 Received: by mail-oi0-x244.google.com with SMTP id x84so4800464oix.2 for ; Thu, 12 Jan 2017 14:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qYHIEAKeSkDqxMJhKwXo/fvRURO/aJ+x4fjYesqoyZ4=; b=WgKperKEWJppUepsDUky+V1qVeTF6YZt5KNvVmRjRT8e45NdA4DSY/cYrE2jdhnp4v 34cE3xDAHiVSkrk/7R+8nGY00ndRS+rKc8iwqkRiBPc/7+xWZV7v1DXHT3y9mTYkfh9q MihTKcRWuZyOpFl4qPav1R5YCkZtMfThNkt31LGkCSCBAD3Da3LRRaSCrTcGL5qzNFXv YelCko9RIbmMijmZMWsDA2aQS78PLyvlQi7eofQ1oG7tFR9Fm0DH/+1VpUpToAwux0du hkNyFo6kiPfsS9mwXq8oORNHSYnExR5XlPLDBLSZLJ7e3jp9SSDlhWi947kDeYWEsm6g FnZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qYHIEAKeSkDqxMJhKwXo/fvRURO/aJ+x4fjYesqoyZ4=; b=N0iubYHN9WbZEEakBRT9Ad6OxuuYnMcph16Iu8IswOveT+7VdKQ8SKhH70WAkl4pXA uW0Xu9t+Jkjul1am4VKwd42JsTaBXT+zXIw6Zt5LD7A4Lvo7qAR0MrfE2c4L9azSsLIu X2MAMx58KmaClWdiAPcFDI1cpWmZec5Ryzk9suS4z9gD6Fkv0CWIZKlHphlW9+C1NIKV KOHoShJWbjsDu1wGPoYAmgiCEYI6D2WB78UzLy03rxPaW27Zpo9Y5iS/SJ3ZL6VNKFwI rBLOJeqDKMkuLWYvMLLbnQlDGXCctNzLMBa1sFzsivo9g/AB54z4E0RQt8ycX2OmrerQ 51ng== X-Gm-Message-State: AIkVDXIPIskAZtSyZJMAZ64wzBwNR8koxj5Mqgv8KJBOdlORyILDEv0rW9yihS/oSOhCfg== X-Received: by 10.157.11.124 with SMTP id p57mr8379634otd.132.1484259990015; Thu, 12 Jan 2017 14:26:30 -0800 (PST) Received: from Christophers-MacBook-Pro.local.com (45-20-192-79.lightspeed.austtx.sbcglobal.net. [45.20.192.79]) by smtp.gmail.com with ESMTPSA id s66sm949101oie.28.2017.01.12.14.26.28 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 12 Jan 2017 14:26:29 -0800 (PST) From: christopher.lee.bostic@gmail.com To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, gregkh@linuxfoundation.org, mturquette@baylibre.com, geert+renesas@glider.be, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, joel@jms.id.au, jk@ozlabs.org, linux-kernel@vger.kernel.org, andrew@aj.id.au, alistair@popple.id.au, benh@kernel.crashing.org Subject: [PATCH v2 05/18] drivers/fsi: Add empty master scan Date: Thu, 12 Jan 2017 16:26:26 -0600 Message-Id: <1484259986-79248-1-git-send-email-christopher.lee.bostic@gmail.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170112_142651_261031_6AB91E00 X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Bostic MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeremy Kerr When a new fsi master is added, we will need to scan its links, and slaves attached to those links. This change introduces a little shell to iterate the links, which we will populate with the actual slave scan in a later change. Signed-off-by: Jeremy Kerr Signed-off-by: Chris Bostic --- drivers/fsi/fsi-core.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 78d9c558..3160c1c 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -20,6 +20,8 @@ #include "fsi-master.h" +#define FSI_N_SLAVES 4 + static DEFINE_IDA(master_ida); struct fsi_slave { @@ -31,8 +33,29 @@ struct fsi_slave { #define to_fsi_slave(d) container_of(d, struct fsi_slave, dev) +/* FSI slave support */ +static int fsi_slave_init(struct fsi_master *master, + int link, uint8_t slave_id) +{ + /* todo: initialise slave device, perform engine scan */ + + return -ENODEV; +} + /* FSI master support */ +static int fsi_master_scan(struct fsi_master *master) +{ + int link, slave_id; + + for (link = 0; link < master->n_links; link++) + for (slave_id = 0; slave_id < FSI_N_SLAVES; slave_id++) + fsi_slave_init(master, link, slave_id); + + return 0; + +} + int fsi_master_register(struct fsi_master *master) { if (!master || !master->dev) @@ -40,6 +63,7 @@ int fsi_master_register(struct fsi_master *master) master->idx = ida_simple_get(&master_ida, 0, 0, GFP_KERNEL); get_device(master->dev); + fsi_master_scan(master); return 0; } EXPORT_SYMBOL_GPL(fsi_master_register);