From patchwork Tue Feb 13 17:45:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 128258 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4454186ljc; Tue, 13 Feb 2018 08:58:42 -0800 (PST) X-Google-Smtp-Source: AH8x227Wf3pet05Sb8FImrj4iTAYqiJEoaMYG5oEitf+JS+uca1rBuyAmvLIvAOcc9zIsb275STP X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr1479780pli.50.1518541121990; Tue, 13 Feb 2018 08:58:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518541121; cv=none; d=google.com; s=arc-20160816; b=cOMBVZzzMStgNvVzekiz5JGR7Au4MAfQDwfB7XP2Jman6hA35TofzjKv1+IQWodWDt ae/rrcXXnDvny21UidrV+zdmuAQAoomHqP7M/DsacGeFsaTSVAAX8qheanUNWTmo1l1T zrkVBr2gRCh9Fi8TAkWmdLhc9Msl7x6jjLGMVco+A5FU4mlfXFo0ZWlWI5gkxyMH6KZE lxgsBFhGIHk7Ms3/aWDLIezZEqtHrmSQzvhsiVPjUpYMTPKKYRTqQqN70ZaP0Itt0uSa WX6XGXXwcOLpjCwCTm/jZhnG2G1Kh+J6RfzK6r6nJxim58j0PGSz00Sh8C1DDKIOAZ8E jpmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=oY4kn3xcA9XJkGDc2vzaYVoif1uenzoqE8yyRaUDYiY=; b=zcSR3fU1NRKuRrzm3TqO8BoDfy6pI4+GLpmr+YkIdhtrVRXNHdFyD2+gKJ+RvCPzNP CdbpMfGu+M+8hOxuX0x9s7oLLzMCsopIbkFEmj5e8U0Ftl2JYKT/rUeVDRdjlfA9J3ac iFUs8QV3qyH9R23kLouoUTrrta8RuGNHENouZ8Gv/xtSNXJTapDNVxOKHbqAqWjbLVfn xnV32lWfUqIftx25Qsbr4bELddDk8BV45E/RKWDAkLQdNomzTcCFhW86ZWc44E01bvo3 kctFAnI9hBAfmUC1SMHpPgqsRqmuwLpZ4yCyBPJMpcWFeVhYnnVg8pXUzpJfiQdH1D6S p/Ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si7670217pld.358.2018.02.13.08.58.41; Tue, 13 Feb 2018 08:58:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965236AbeBMQ5T (ORCPT + 28 others); Tue, 13 Feb 2018 11:57:19 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5237 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934845AbeBMQ44 (ORCPT ); Tue, 13 Feb 2018 11:56:56 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 65A9BFB41FF87; Wed, 14 Feb 2018 00:56:36 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Wed, 14 Feb 2018 00:56:28 +0800 From: John Garry To: , , , , , , , , , , , , CC: , , , , , , , , , Subject: [PATCH v13 8/9] LPC, ACPI: Add the HISI LPC ACPI support Date: Wed, 14 Feb 2018 01:45:32 +0800 Message-ID: <1518543933-22456-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518543933-22456-1-git-send-email-john.garry@huawei.com> References: <1518543933-22456-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Based on the previous patches, this patch supports the LPC host on Hip06/Hip07 for ACPI FW. Signed-off-by: John Garry Signed-off-by: Zhichang Yuan Signed-off-by: Gabriele Paoloni Tested-by: Dann Frazier --- drivers/acpi/arm64/acpi_indirectio.c | 1 + drivers/bus/hisi_lpc.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/acpi/arm64/acpi_indirectio.c b/drivers/acpi/arm64/acpi_indirectio.c index 51a1b92..52519a21 100644 --- a/drivers/acpi/arm64/acpi_indirectio.c +++ b/drivers/acpi/arm64/acpi_indirectio.c @@ -225,6 +225,7 @@ static int acpi_indirect_io_setup(struct acpi_device *adev) /* All the host devices which apply indirect-IO can be listed here. */ static const struct acpi_device_id acpi_indirect_io_host_id[] = { + {"HISI0191"}, {} }; diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 2290cf2..6211c95 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -439,7 +439,13 @@ static int hisilpc_probe(struct platform_device *pdev) } /* register the LPC host PIO resources */ - { + if (has_acpi_companion(dev)) { + lpcdev->io_host = find_io_range_by_fwnode(dev->fwnode); + if (!lpcdev->io_host) { + dev_err(dev, "range not registered!\n"); + return -EFAULT; + } + } else { struct logic_pio_hwaddr *range; range = devm_kzalloc(dev, sizeof(*range), GFP_KERNEL); @@ -496,10 +502,19 @@ 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, };