From mboxrd@z Thu Jan 1 00:00:00 1970 From: "zhichang.yuan" Subject: [PATCH V8 6/6] LPC: Add the ACPI LPC support Date: Thu, 30 Mar 2017 23:26:59 +0800 Message-ID: <1490887619-61732-7-git-send-email-yuanzhichang@hisilicon.com> References: <1490887619-61732-1-git-send-email-yuanzhichang@hisilicon.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1490887619-61732-1-git-send-email-yuanzhichang@hisilicon.com> Sender: linux-pci-owner@vger.kernel.org To: catalin.marinas@arm.com, will.deacon@arm.com, robh+dt@kernel.org, frowand.list@gmail.com, bhelgaas@google.com, rafael@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, brian.starkey@arm.com, olof@lixom.net, lorenzo.pieralisi@arm.com, benh@kernel.crashing.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxarm@huawei.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, minyard@acm.org, zourongrong@gmail.com, john.garry@huawei.com, gabriele.paoloni@huawei.com, zhichang.yuan02@gmail.com, kantyzc@163.com, xuwei5@hisilicon.com, "zhichang.yuan" List-Id: linux-acpi@vger.kernel.org Based on the provious patches, this patch supports the ACPI LPC host on Hip06/Hip07. Signed-off-by: zhichang.yuan Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 018ea37..ef62045 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -458,7 +458,9 @@ static int hisilpc_probe(struct platform_device *pdev) } /* register the LPC host PIO resources */ - if (!has_acpi_companion(dev)) { + if (has_acpi_companion(dev)) { + lpcdev->io_host = find_io_range_by_fwnode(dev->fwnode); + } else { struct logic_pio_hwaddr *range, *tmprange; range = kzalloc(sizeof(*range), GFP_KERNEL); @@ -526,10 +528,18 @@ static int hisilpc_probe(struct platform_device *pdev) {}, }; +#ifdef CONFIG_ACPI +static const struct acpi_device_id hisilpc_acpi_match[] = { + {"HISI0191", }, + {}, +}; +#endif + static struct platform_driver hisilpc_driver = { .driver = { .name = "hisi_lpc", .of_match_table = hisilpc_of_match, + .acpi_match_table = ACPI_PTR(hisilpc_acpi_match), }, .probe = hisilpc_probe, }; -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934143AbdC3Ozw (ORCPT ); Thu, 30 Mar 2017 10:55:52 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:4853 "EHLO dggrg02-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933746AbdC3Ozs (ORCPT ); Thu, 30 Mar 2017 10:55:48 -0400 From: "zhichang.yuan" To: , , , , , , , CC: , , , , , , , , , , , , , , , , , "zhichang.yuan" Subject: [PATCH V8 6/6] LPC: Add the ACPI LPC support Date: Thu, 30 Mar 2017 23:26:59 +0800 Message-ID: <1490887619-61732-7-git-send-email-yuanzhichang@hisilicon.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490887619-61732-1-git-send-email-yuanzhichang@hisilicon.com> References: <1490887619-61732-1-git-send-email-yuanzhichang@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.58DD1C6F.0177,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ca34c3d2be8a4524e4c84f6235f35975 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Based on the provious patches, this patch supports the ACPI LPC host on Hip06/Hip07. Signed-off-by: zhichang.yuan Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 018ea37..ef62045 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -458,7 +458,9 @@ static int hisilpc_probe(struct platform_device *pdev) } /* register the LPC host PIO resources */ - if (!has_acpi_companion(dev)) { + if (has_acpi_companion(dev)) { + lpcdev->io_host = find_io_range_by_fwnode(dev->fwnode); + } else { struct logic_pio_hwaddr *range, *tmprange; range = kzalloc(sizeof(*range), GFP_KERNEL); @@ -526,10 +528,18 @@ static int hisilpc_probe(struct platform_device *pdev) {}, }; +#ifdef CONFIG_ACPI +static const struct acpi_device_id hisilpc_acpi_match[] = { + {"HISI0191", }, + {}, +}; +#endif + static struct platform_driver hisilpc_driver = { .driver = { .name = "hisi_lpc", .of_match_table = hisilpc_of_match, + .acpi_match_table = ACPI_PTR(hisilpc_acpi_match), }, .probe = hisilpc_probe, }; -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: yuanzhichang@hisilicon.com (zhichang.yuan) Date: Thu, 30 Mar 2017 23:26:59 +0800 Subject: [PATCH V8 6/6] LPC: Add the ACPI LPC support In-Reply-To: <1490887619-61732-1-git-send-email-yuanzhichang@hisilicon.com> References: <1490887619-61732-1-git-send-email-yuanzhichang@hisilicon.com> Message-ID: <1490887619-61732-7-git-send-email-yuanzhichang@hisilicon.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Based on the provious patches, this patch supports the ACPI LPC host on Hip06/Hip07. Signed-off-by: zhichang.yuan Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 018ea37..ef62045 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -458,7 +458,9 @@ static int hisilpc_probe(struct platform_device *pdev) } /* register the LPC host PIO resources */ - if (!has_acpi_companion(dev)) { + if (has_acpi_companion(dev)) { + lpcdev->io_host = find_io_range_by_fwnode(dev->fwnode); + } else { struct logic_pio_hwaddr *range, *tmprange; range = kzalloc(sizeof(*range), GFP_KERNEL); @@ -526,10 +528,18 @@ static int hisilpc_probe(struct platform_device *pdev) {}, }; +#ifdef CONFIG_ACPI +static const struct acpi_device_id hisilpc_acpi_match[] = { + {"HISI0191", }, + {}, +}; +#endif + static struct platform_driver hisilpc_driver = { .driver = { .name = "hisi_lpc", .of_match_table = hisilpc_of_match, + .acpi_match_table = ACPI_PTR(hisilpc_acpi_match), }, .probe = hisilpc_probe, }; -- 1.9.1