From patchwork Wed Dec 7 00:14:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Bostic X-Patchwork-Id: 9463583 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 B259460459 for ; Wed, 7 Dec 2016 00:18:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A491B284D0 for ; Wed, 7 Dec 2016 00:18:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98252284F2; Wed, 7 Dec 2016 00:18:41 +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 AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33565284D0 for ; Wed, 7 Dec 2016 00:18:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEPv7-0006T2-03; Wed, 07 Dec 2016 00:17:13 +0000 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEPtR-0005Gc-Rg for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2016 00:15:31 +0000 Received: by mail-oi0-x241.google.com with SMTP id u15so43563522oie.3 for ; Tue, 06 Dec 2016 16:15:13 -0800 (PST) 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=5FeXAVvAkHN73ho6Kshk5DLb13z6U3CiBG8MaUo51Jg=; b=aUi+16zMOMzZtmdiBuqtY6bKtSfnt+q+UkGuCC/wzJt5depfV3F4z0r7KEDx4NGvv1 dhbgiucglqnbc3kL7qw26vlhU6sOgHxUFFY2suFy69NQyznHnQ+md8xvcbp7GEvUNdz4 j6wOfEjbljCMCdttuHCi2x++VC3FnyqTMhtWpKRn2RPfcAdx5abVwKjjh4d6VjzRutD0 hyby7UVkCnibuDeCvN7l3R00gon7N05HmrMwXBCVH3zaTB8b9FLNzGpSGW1XVkrt0tye R20UQqgoJRDxD8d3HmrAY6LA6wOju/oL+sh4LDtj/t8oFmHJ2bz/QPFBHXZjtAO7Q8Uf btkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5FeXAVvAkHN73ho6Kshk5DLb13z6U3CiBG8MaUo51Jg=; b=VGhM30e8MHL4JWlZ04lfdWhgNUQHx2y1IG+/UMVgmXoYGdoRVngSXQycNdupP0CsHc +K2OU89DDJ4ZBCqLTbczlAbFOi3ZQ3wDjJv6ykUdEoTrV6cASRjUy85lgZV2WY8QViMp rjWZYVdYma0G38/5IanOW+27eMnLmZwlpS7p/UI6LgJY91xiFLuQRhLD4lsVLiQ5zfja Gxcv0xxpz+WBBYJ9vq/ZyEdIKNC2VmPixcCv+EUw8wgNlfWloPvBocOqeQwglLetn8Z7 BYSTue39K6TD4ushLi4h88Iifv1w0bpC4fHeQ/k/Bpvgx6gvBjmbmtSMTB6Xr/PZvyGP I72A== X-Gm-Message-State: AKaTC00v4EXooyme6foYdhtJ4Ry4XaTg2o7XvEtDwVGgNykEJkR4QkRlURtEa5Ta02VQJg== X-Received: by 10.157.12.182 with SMTP id b51mr34167889otb.66.1481069713018; Tue, 06 Dec 2016 16:15:13 -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 r102sm8568294ota.11.2016.12.06.16.15.11 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Dec 2016 16:15:11 -0800 (PST) From: Chris Bostic To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, gregkh@linuxfoundation.org, sre@kernel.org, mturquette@baylibre.com, geert+renesas@glider.be, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/16] drivers/fsi: Add empty master scan Date: Tue, 6 Dec 2016 18:14:28 -0600 Message-Id: <1481069677-53660-8-git-send-email-christopher.lee.bostic@gmail.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) In-Reply-To: <1481069677-53660-1-git-send-email-christopher.lee.bostic@gmail.com> References: <1481069677-53660-1-git-send-email-christopher.lee.bostic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161206_161530_039200_03D66C98 X-CRM114-Status: GOOD ( 10.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrew@aj.id.au, alistair@popple.id.au, linux-kernel@vger.kernel.org, Chris Bostic , Jeremy Kerr , benh@kernel.crashing.org, joel@jms.id.au 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 60a6d91..ceaf536 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -19,6 +19,8 @@ #include "fsi-master.h" +#define FSI_N_SLAVES 4 + static atomic_t master_idx = ATOMIC_INIT(-1); struct fsi_slave { @@ -30,12 +32,34 @@ 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) { master->idx = atomic_inc_return(&master_idx); get_device(master->dev); + fsi_master_scan(master); return 0; } EXPORT_SYMBOL_GPL(fsi_master_register);