From patchwork Thu Mar 30 15:26:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichang Yuan X-Patchwork-Id: 745294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vv73r4g19z9s1y for ; Fri, 31 Mar 2017 01:55:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933915AbdC3Ozt (ORCPT ); Thu, 30 Mar 2017 10:55:49 -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 Received: from 172.30.72.57 (EHLO DGGEML404-HUB.china.huawei.com) ([172.30.72.57]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AKU82274; Thu, 30 Mar 2017 22:55:43 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEML404-HUB.china.huawei.com (10.3.17.39) with Microsoft SMTP Server id 14.3.301.0; Thu, 30 Mar 2017 22:55:32 +0800 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 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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, };