From patchwork Wed Aug 24 22:04:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Dasu X-Patchwork-Id: 9298411 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 C131B60459 for ; Wed, 24 Aug 2016 22:06:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B164C29139 for ; Wed, 24 Aug 2016 22:06:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A639F2913B; Wed, 24 Aug 2016 22:06: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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B11129139 for ; Wed, 24 Aug 2016 22:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757034AbcHXWGk (ORCPT ); Wed, 24 Aug 2016 18:06:40 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:34707 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756926AbcHXWGj (ORCPT ); Wed, 24 Aug 2016 18:06:39 -0400 Received: by mail-pa0-f66.google.com with SMTP id hh10so1889633pac.1 for ; Wed, 24 Aug 2016 15:06:39 -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=+oEYxRBRvSlA6nf6OlN+WHB86RmAx5X2TTD37YsWtOo=; b=BxThF7c9n+LkMfgpqYS00zrhWh1ZBV1BE7PXsVwiJQY4pmkyBpGOnkZvKwf8e4cecG rAaXKtApH0KmxgwirX96R6EbQQCYF+FQc5gx3am6CBTTPPKfBiNrVkPDdW6h6eZjly+5 xTSw1NUeb4dz7GAnl50lxgkdf5ZUxCrHpbt4TmrNmy0k4Q+XYZ27SE0RrfSaLkRvTrqZ 1DRgyACKzg1+qmWMpR+vmteSknmqDgAuvYbLsUPSc+R3f3UpWpsoAeHLwB8v24t5gcuz ko7AWencXU9K5tcaszFNzwjTqMOYHfLcDAlouAjidkd/Xit5z/0RQadkWKzpR1yC6CB7 WZFg== 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=+oEYxRBRvSlA6nf6OlN+WHB86RmAx5X2TTD37YsWtOo=; b=LuTXti+28riwlcaOE4ruA+rmtyHyFSLnaEMceSlvicKRHkICuKFlzLYy3EekRt2PNJ sRp3cyd2KyS4f7FqopTzt1QozleeVYJuwgca854wgjcKfO5Vq4/jf8vNWfVk2CFZIs7N r2kbz+fL6upvOq59aI7rJ/QpvxTNcFjT5xJstdEZlsjPkqsY+xwwOX3LTvqPDgANFORD FVneVLTD/X1Vj4rkdEVLDmWqVgYYLk/l4Q+N9h5x2tAeavo5MYBexxY/vqW/fR4y8GF8 52q+U112+/OX7cQSJetaaC7gSOjL2RxIIPr9tCUrQr177EDrvRI+/Z9bfMc8PkyXSQDY I+9g== X-Gm-Message-State: AE9vXwO251w25+O8cnQC2fo+qh1zQK8l7QDsCQxFqPDdNRjDzHPaStG28TcGZsYV7/I7Jg== X-Received: by 10.66.66.42 with SMTP id c10mr9849205pat.83.1472076398574; Wed, 24 Aug 2016 15:06:38 -0700 (PDT) Received: from mail.broadcom.com ([216.31.219.19]) by smtp.gmail.com with ESMTPSA id wa9sm15966968pac.35.2016.08.24.15.06.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Aug 2016 15:06:37 -0700 (PDT) From: Kamal Dasu To: broonie@kernel.org, linux-spi@vger.kernel.org, computersforpeace@gmail.com, linux-mtd@lists.infradead.org, vigneshr@ti.com, f.fainelli@gmail.com, yendapally.reddy@broadcom.com Cc: bcm-kernel-feedback-list@broadcom.com, jon.mason@broadcom.com, Kamal Dasu Subject: [PATCH v6, 3/8] spi: brcmstb-qspi: Broadcom settop platform driver Date: Wed, 24 Aug 2016 18:04:24 -0400 Message-Id: <1472076269-4731-4-git-send-email-kdasu.kdev@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472076269-4731-1-git-send-email-kdasu.kdev@gmail.com> References: <1472076269-4731-1-git-send-email-kdasu.kdev@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adding the settop SoC platfrom driver, this driver is compatible with the settop MSPI+BSPI and MSPI only blocks implemented on the SoCs. Driver calls the spi-bcm-qspi probe(), remove() and pm_ops. Signed-off-by: Kamal Dasu --- drivers/spi/Makefile | 2 +- drivers/spi/spi-brcmstb-qspi.c | 53 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 drivers/spi/spi-brcmstb-qspi.c diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index 4a715f3..3e753db 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -21,7 +21,7 @@ obj-$(CONFIG_SPI_BCM2835AUX) += spi-bcm2835aux.o obj-$(CONFIG_SPI_BCM53XX) += spi-bcm53xx.o obj-$(CONFIG_SPI_BCM63XX) += spi-bcm63xx.o obj-$(CONFIG_SPI_BCM63XX_HSSPI) += spi-bcm63xx-hsspi.o -obj-$(CONFIG_SPI_BCM_QSPI) += spi-bcm-qspi.o +obj-$(CONFIG_SPI_BCM_QSPI) += spi-brcmstb-qspi.o spi-bcm-qspi.o obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o obj-$(CONFIG_SPI_ADI_V3) += spi-adi-v3.o obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o diff --git a/drivers/spi/spi-brcmstb-qspi.c b/drivers/spi/spi-brcmstb-qspi.c new file mode 100644 index 0000000..c7df92e --- /dev/null +++ b/drivers/spi/spi-brcmstb-qspi.c @@ -0,0 +1,53 @@ +/* + * Copyright 2016 Broadcom + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation (the "GPL"). + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 (GPLv2) for more details. + * + * You should have received a copy of the GNU General Public License + * version 2 (GPLv2) along with this source code. + */ + +#include +#include +#include +#include +#include "spi-bcm-qspi.h" + +static const struct of_device_id brcmstb_qspi_of_match[] = { + { .compatible = "brcm,spi-brcmstb-qspi" }, + { .compatible = "brcm,spi-brcmstb-mspi" }, + {}, +}; +MODULE_DEVICE_TABLE(of, brcmstb_qspi_of_match); + +static int brcmstb_qspi_probe(struct platform_device *pdev) +{ + return bcm_qspi_probe(pdev, NULL); +} + +static int brcmstb_qspi_remove(struct platform_device *pdev) +{ + return bcm_qspi_remove(pdev); +} + +static struct platform_driver brcmstb_qspi_driver = { + .probe = brcmstb_qspi_probe, + .remove = brcmstb_qspi_remove, + .driver = { + .name = "brcmstb_qspi", + .pm = &bcm_qspi_pm_ops, + .of_match_table = brcmstb_qspi_of_match, + } +}; +module_platform_driver(brcmstb_qspi_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Kamal Dasu"); +MODULE_DESCRIPTION("Broadcom SPI driver for settop SoC");