From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752715AbdB1QML (ORCPT ); Tue, 28 Feb 2017 11:12:11 -0500 Received: from mga01.intel.com ([192.55.52.88]:49194 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbdB1QLd (ORCPT ); Tue, 28 Feb 2017 11:11:33 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,220,1484035200"; d="scan'208";a="1116635091" Date: Tue, 28 Feb 2017 07:44:47 -0800 (PST) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@mgerlach-VirtualBox To: Moritz Fischer cc: Alan Tull , linux-fpga@vger.kernel.org, Linux Kernel Mailing List , Matthew Gerlach Subject: Re: [PATCH] fpga fr br: separate freeze bridge driver code In-Reply-To: Message-ID: References: <1488225820-22822-1-git-send-email-matthew.gerlach@linux.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Feb 2017, Moritz Fischer wrote: > Hi Matthew, > > small nit inline. > > On Mon, Feb 27, 2017 at 12:03 PM, wrote: >> From: Matthew Gerlach >> >> This patch separates the core Freeze Bridge >> driver code from the platform driver code. >> The intent is to allow the core driver code >> to be used without requiring platform driver support. >> >> Signed-off-by: Matthew Gerlach >> --- >> drivers/fpga/Kconfig | 7 ++++ >> drivers/fpga/Makefile | 1 + >> drivers/fpga/altera-freeze-bridge-plat.c | 65 ++++++++++++++++++++++++++++++++ >> drivers/fpga/altera-freeze-bridge.c | 41 ++++---------------- >> drivers/fpga/altera-freeze-bridge.h | 26 +++++++++++++ >> 5 files changed, 107 insertions(+), 33 deletions(-) >> create mode 100644 drivers/fpga/altera-freeze-bridge-plat.c >> create mode 100644 drivers/fpga/altera-freeze-bridge.h >> >> diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig >> index ce861a2..1a1fc47 100644 >> --- a/drivers/fpga/Kconfig >> +++ b/drivers/fpga/Kconfig >> @@ -63,6 +63,13 @@ config ALTERA_FREEZE_BRIDGE >> isolate one region of the FPGA from the busses while that >> region is being reprogrammed. >> >> +config ALTERA_FREEZE_BRIDGE_PLAT >> + tristate "Platform support of Altera FPGA Freeze Bridge" >> + depends on ALTERA_FREEZE_BRIDGE && OF && HAS_IOMEM >> + help >> + Say Y to enable platform driver support for Altera FPGA >> + Freeze bridges. >> + >> endif # FPGA >> >> endmenu >> diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile >> index 8df07bc..a270c00 100644 >> --- a/drivers/fpga/Makefile >> +++ b/drivers/fpga/Makefile >> @@ -14,6 +14,7 @@ obj-$(CONFIG_FPGA_MGR_ZYNQ_FPGA) += zynq-fpga.o >> obj-$(CONFIG_FPGA_BRIDGE) += fpga-bridge.o >> obj-$(CONFIG_SOCFPGA_FPGA_BRIDGE) += altera-hps2fpga.o altera-fpga2sdram.o >> obj-$(CONFIG_ALTERA_FREEZE_BRIDGE) += altera-freeze-bridge.o >> +obj-$(CONFIG_ALTERA_FREEZE_BRIDGE_PLAT) += altera-freeze-bridge-plat.o >> >> # High Level Interfaces >> obj-$(CONFIG_FPGA_REGION) += fpga-region.o >> diff --git a/drivers/fpga/altera-freeze-bridge-plat.c b/drivers/fpga/altera-freeze-bridge-plat.c >> new file mode 100644 >> index 0000000..44ce539 >> --- /dev/null >> +++ b/drivers/fpga/altera-freeze-bridge-plat.c >> @@ -0,0 +1,65 @@ >> +/* >> + * Platform Driver Support for FPGA Freeze Bridge Controller >> + * >> + * Copyright (C) 2016 Altera Corporation. All rights reserved. >> + * Copyright (C) 2016-2017 Intel Corporation. All rights reserved. >> + * >> + * This program is free software; you can redistribute it and/or modify it >> + * under the terms and conditions of the GNU General Public License, >> + * version 2, as published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope 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 for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public License along with >> + * this program. If not, see . >> + */ >> +#include "altera-freeze-bridge.h" >> +#include >> +#include >> +#include >> +#include >> + >> +static int altera_freeze_br_platform_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + struct device_node *np = pdev->dev.of_node; >> + struct resource *res; >> + void __iomem *reg_base; >> + >> + if (!np) >> + return -ENODEV; >> + >> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> + >> + reg_base = devm_ioremap_resource(dev, res); >> + >> + if (IS_ERR(reg_base)) >> + return PTR_ERR(reg_base); >> + >> + return altera_freeze_br_probe(dev, reg_base); > > Maybe you can call this 'register' instead of 'probe' since the > probing is basically > done at this point. The same comment basically applies to the pr-core I > think. > Hi Moritz, This is very good suggestion. Having a "probe" function and a "platform_probe" function was confusing to some people. 'register' makes a lot of sense. Matthew Gerlach > Thanks, > > Moritz > -- > To unsubscribe from this list: send the line "unsubscribe linux-fpga" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >