From patchwork Tue May 8 10:27:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 135143 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp4208698lji; Tue, 8 May 2018 03:31:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqB2JqJBVkFqBwNmvQi0oO6wGPpnQIeA7nbgwM4Armdj8cBld5QftQH48WuNQXte9ft0tEq X-Received: by 2002:a17:902:a5:: with SMTP id a34-v6mr40991345pla.58.1525775469900; Tue, 08 May 2018 03:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525775469; cv=none; d=google.com; s=arc-20160816; b=dGzBR2IZwqM2RZw/VB6jJP7uZ1voUtW64eqh1WKoiERqpC5lDs24A97WYsy4aZat+b Er4ET/HKSc+WmdsumBaBAj4ZFrMTiiX9d9D6ik4qmRDd0O6Bam9k1BzDvsM9aW1UCMJk ZWMyzCjQizOtQYoUlOjAjqv8yx1yRXwJqBdqArp/a5i9avZxo2uQZ6i8Xy/8LB6QFWwT zhgIb8oktzUv4Iwn/j8c56hN6RvGbM/ebaKTlZgqipmj8S7UJ8cKODLntNshcSxpAREC AB0vJfurh2oOXLvsXnddk6X5g/O25UU5JzzSUO7TnQ6VlSDjN6luJ300WfhKayYVobgq pSDg== 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=2sUAcj+LkNOdpvjuuwIXu+yQikFcERmBwUd+DFiWD6o=; b=LBDz12kVgcAZf8/2A/YdJWNPVQ7N7wMeJsazpzgCkrcSHZjh4dd5/M49pTPVtkMWst vNsxRIVyWPMBnOi5g0NhbtphuwPY19m+Rb1ec1lXI3sRocJwsBy0x8oROgYEuzlSH/cF DVneJ0++Qt64YOCB8OrgCGLnurvteokJKxdzLp2UP2YTi5UtJJVDLsbQA8RaztW9O5O8 XqlI8ITyz9gIfdBSn2owHiaaNonpOuEFFBvMMW/Q1Uk+gRcblq2e0cKtvPDJU6h9AW2H hCNlCrhOTQ7OLzU9gmLvNN592rsxi66XErgZauBseb4EM5oRANnqkhwGyBDnAg0SxGRL j4Rg== 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 g77si25292263pfa.304.2018.05.08.03.31.09; Tue, 08 May 2018 03:31:09 -0700 (PDT) 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 S932370AbeEHKbF (ORCPT + 29 others); Tue, 8 May 2018 06:31:05 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7243 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754631AbeEHKbA (ORCPT ); Tue, 8 May 2018 06:31:00 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 70E85188D1D08; Tue, 8 May 2018 18:30:46 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Tue, 8 May 2018 18:30:39 +0800 From: John Garry To: , , , CC: , , , , , , , John Garry Subject: [PATCH v2 1/3] HISI LPC: Stop using MFD APIs Date: Tue, 8 May 2018 18:27:30 +0800 Message-ID: <1525775252-239214-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525775252-239214-1-git-send-email-john.garry@huawei.com> References: <1525775252-239214-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 The MFD APIs should only be used by drivers in drivers/mfd. It is not worth splitting the driver to have separate parts in drivers/bus and drivers/mfd, so just drop MFD API usage. As a solution, we will use the platform device APIs directly to achieve the same as we had when using MFD APIs. Signed-off-by: John Garry --- drivers/bus/Kconfig | 1 - drivers/bus/hisi_lpc.c | 72 ++++++-------------------------------------------- 2 files changed, 8 insertions(+), 65 deletions(-) -- 1.9.1 diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 6dc177b..d1c0b60 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -33,7 +33,6 @@ config HISILICON_LPC bool "Support for ISA I/O space on HiSilicon Hip06/7" depends on ARM64 && (ARCH_HISI || COMPILE_TEST) select INDIRECT_PIO - select MFD_CORE if ACPI help Driver to enable I/O access to devices attached to the Low Pin Count bus on the HiSilicon Hip06/7 SoC. diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 2d4611e..252a6a4 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -341,15 +340,6 @@ static void hisi_lpc_comm_outs(void *hostdata, unsigned long pio, }; #ifdef CONFIG_ACPI -#define MFD_CHILD_NAME_PREFIX DRV_NAME"-" -#define MFD_CHILD_NAME_LEN (ACPI_ID_LEN + sizeof(MFD_CHILD_NAME_PREFIX) - 1) - -struct hisi_lpc_mfd_cell { - struct mfd_cell_acpi_match acpi_match; - char name[MFD_CHILD_NAME_LEN]; - char pnpid[ACPI_ID_LEN]; -}; - static int hisi_lpc_acpi_xlat_io_res(struct acpi_device *adev, struct acpi_device *host, struct resource *res) @@ -368,7 +358,7 @@ static int hisi_lpc_acpi_xlat_io_res(struct acpi_device *adev, } /* - * hisi_lpc_acpi_set_io_res - set the resources for a child's MFD + * hisi_lpc_acpi_set_io_res - set the resources for a child * @child: the device node to be updated the I/O resource * @hostdev: the device node associated with host controller * @res: double pointer to be set to the address of translated resources @@ -458,69 +448,23 @@ static int hisi_lpc_acpi_set_io_res(struct device *child, * * Returns 0 when successful, and a negative value for failure. * - * Scan all child devices and create a per-device MFD with - * logical PIO translated IO resources. */ static int hisi_lpc_acpi_probe(struct device *hostdev) { struct acpi_device *adev = ACPI_COMPANION(hostdev); - struct hisi_lpc_mfd_cell *hisi_lpc_mfd_cells; - struct mfd_cell *mfd_cells; struct acpi_device *child; - int size, ret, count = 0, cell_num = 0; - - list_for_each_entry(child, &adev->children, node) - cell_num++; - - /* allocate the mfd cell and companion ACPI info, one per child */ - size = sizeof(*mfd_cells) + sizeof(*hisi_lpc_mfd_cells); - mfd_cells = devm_kcalloc(hostdev, cell_num, size, GFP_KERNEL); - if (!mfd_cells) - return -ENOMEM; + int ret; - hisi_lpc_mfd_cells = (struct hisi_lpc_mfd_cell *)&mfd_cells[cell_num]; /* Only consider the children of the host */ list_for_each_entry(child, &adev->children, node) { - struct mfd_cell *mfd_cell = &mfd_cells[count]; - struct hisi_lpc_mfd_cell *hisi_lpc_mfd_cell = - &hisi_lpc_mfd_cells[count]; - struct mfd_cell_acpi_match *acpi_match = - &hisi_lpc_mfd_cell->acpi_match; - char *name = hisi_lpc_mfd_cell[count].name; - char *pnpid = hisi_lpc_mfd_cell[count].pnpid; - struct mfd_cell_acpi_match match = { - .pnpid = pnpid, - }; - - /* - * For any instances of this host controller (Hip06 and Hip07 - * are the only chipsets), we would not have multiple slaves - * with the same HID. And in any system we would have just one - * controller active. So don't worrry about MFD name clashes. - */ - snprintf(name, MFD_CHILD_NAME_LEN, MFD_CHILD_NAME_PREFIX"%s", - acpi_device_hid(child)); - snprintf(pnpid, ACPI_ID_LEN, "%s", acpi_device_hid(child)); - - memcpy(acpi_match, &match, sizeof(*acpi_match)); - mfd_cell->name = name; - mfd_cell->acpi_match = acpi_match; - - ret = hisi_lpc_acpi_set_io_res(&child->dev, &adev->dev, - &mfd_cell->resources, - &mfd_cell->num_resources); + const struct resource *res; + int num_res; + + ret = hisi_lpc_acpi_set_io_res(&child->dev, &adev->dev, &res, + &num_res); if (ret) { - dev_warn(&child->dev, "set resource fail (%d)\n", ret); - return ret; + dev_warn(hostdev, "set resource fail (%d)\n", ret); } - count++; - } - - ret = mfd_add_devices(hostdev, PLATFORM_DEVID_NONE, - mfd_cells, cell_num, NULL, 0, NULL); - if (ret) { - dev_err(hostdev, "failed to add mfd cells (%d)\n", ret); - return ret; } return 0; From patchwork Tue May 8 10:27:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 135144 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp4209025lji; Tue, 8 May 2018 03:31:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrwAYb51adh/LAri5zNO5AqgBZx0sfH38Ry46MTZOA+/xFw8S8E24OWVIQvvPLyKBLGKU9t X-Received: by 2002:a17:902:bb93:: with SMTP id m19-v6mr21001309pls.74.1525775490189; Tue, 08 May 2018 03:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525775490; cv=none; d=google.com; s=arc-20160816; b=LJ7mvo0Mw0fQRdeOwJyoP7/szYvcCP8i9YUa9C1a4OuBT63OkuCa1/OAuUXWkyoEMY M2PscORuI7vmzlV6REaSFRshc6/rlXMEQQccjnN6ibyPs1kLRhvXPV1LGmXa5YA+1S6Q XzLGwgpQs4kIqBHGlcvjJWwHChgKJs3sFPj0nVaBixRci6DbHZ1EXjMaEZw42B2FwBGA P0oVKvsAovqAgitM/FcSt5gcIWDU+piGfRLbe94auEkaST5IOaMflID0GVOdtuP7iL3j nh5IF4pmnuE7agtRH7G00/xRv+erbs+H0Uwo966/ohT/6wlMXKOGH0ORXgB0iY8RmlW3 3wyA== 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=ZNACVdP/6b7WsvoOatnGiX63Z3Om2Lv6ZRc0wquD93M=; b=l0pkXdbIvW9lsWBPiuCO+L9/oH0DHwQpt1KKRaHGoSfr8nnTVZdVwIBW8PqXD7ysAn aU/RvCqPJbp2Q01H0u+UVBlD/uyNhYNKaZTAz+kp06Yw586yg6kCkXivLQ0jJECGLZaP OtrZ52aOmYrMK0Mo4NaETkxOgxantN1RGpZHvhM6GUoBR8CoclSraD9YCQnrcSf0a7F2 xFAWiBEbc5ewnwjru3KVNrfliv0AqkcK/Gh9Fl6z+59HuTNM/NQzljsYAff2J7lTiAmw wa5uhtXXgAOiOL1NntX4H5Z2rTHdARQ2YgQ1Wtpi5m67ZJ2fm/HAd85wZBpJyMJDZFUT Zg8g== 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 g77si25292263pfa.304.2018.05.08.03.31.29; Tue, 08 May 2018 03:31:30 -0700 (PDT) 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 S932286AbeEHKbD (ORCPT + 29 others); Tue, 8 May 2018 06:31:03 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7242 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754628AbeEHKa7 (ORCPT ); Tue, 8 May 2018 06:30:59 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 61305E72D903E; Tue, 8 May 2018 18:30:46 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Tue, 8 May 2018 18:30:39 +0800 From: John Garry To: , , , CC: , , , , , , , John Garry Subject: [PATCH v2 2/3] HISI LPC: Re-Add ACPI child enumeration support Date: Tue, 8 May 2018 18:27:31 +0800 Message-ID: <1525775252-239214-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525775252-239214-1-git-send-email-john.garry@huawei.com> References: <1525775252-239214-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 Since we no longer use the MFD APIs to enumerate the child devices on the bus, use the platform driver APIs directly. In this patch we iterate of the children devices for the host, and create a platform device directly per child. For the iterating, we match the child ACPI HID against a known list of supported child devices and their respective ACPIs HID, to find the device name and any other supplementary data. Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) -- 1.9.1 diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 252a6a4..eb5b3fc 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -442,12 +442,28 @@ static int hisi_lpc_acpi_set_io_res(struct device *child, return 0; } +static int hisi_lpc_acpi_remove_subdev(struct device *dev, void *unused) +{ + platform_device_unregister(to_platform_device(dev)); + return 0; +} + +struct hisi_lpc_acpi_cell { + const char *hid; + const char *name; + void *pdata; + size_t pdata_size; +}; + /* * hisi_lpc_acpi_probe - probe children for ACPI FW * @hostdev: LPC host device pointer * * Returns 0 when successful, and a negative value for failure. * + * Create a platform device per child, fixing up the resources + * from bus addresses to Logical PIO addresses. + * */ static int hisi_lpc_acpi_probe(struct device *hostdev) { @@ -457,17 +473,75 @@ static int hisi_lpc_acpi_probe(struct device *hostdev) /* Only consider the children of the host */ list_for_each_entry(child, &adev->children, node) { + const char *hid = acpi_device_hid(child); + const struct hisi_lpc_acpi_cell *cell; + struct platform_device *pdev; const struct resource *res; + bool found = false; int num_res; ret = hisi_lpc_acpi_set_io_res(&child->dev, &adev->dev, &res, &num_res); if (ret) { dev_warn(hostdev, "set resource fail (%d)\n", ret); + goto fail; + } + + cell = (struct hisi_lpc_acpi_cell []){ + /* ipmi */ + { + .hid = "IPI0001", + .name = "hisi-lpc-ipmi", + }, + {} + }; + + for (; cell && cell->name; cell++) { + if (!strcmp(cell->hid, hid)) { + found = true; + break; + } } + + if (!found) { + dev_warn(hostdev, + "could not find cell for child device (%s)\n", + hid); + ret = -ENODEV; + goto fail; + } + + pdev = platform_device_alloc(cell->name, PLATFORM_DEVID_AUTO); + if (!pdev) { + ret = -ENOMEM; + goto fail; + } + + pdev->dev.parent = hostdev; + ACPI_COMPANION_SET(&pdev->dev, child); + + ret = platform_device_add_resources(pdev, res, num_res); + if (ret) + goto fail; + + ret = platform_device_add_data(pdev, cell->pdata, + cell->pdata_size); + if (ret) + goto fail; + + ret = platform_device_add(pdev); + if (ret) + goto fail; + + acpi_device_set_enumerated(child); } return 0; + +fail: + device_for_each_child(hostdev, NULL, + hisi_lpc_acpi_remove_subdev); + return ret; } static const struct acpi_device_id hisi_lpc_acpi_match[] = { From patchwork Tue May 8 10:27: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: 135145 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp4209212lji; Tue, 8 May 2018 03:31:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoM1cmfLfF2sTt0b2Oce5CGimvsOHVEBMnXviaqC4nSQdCd+jsPSu110tHyvjGzwKEBOcrr X-Received: by 2002:a17:902:bf45:: with SMTP id u5-v6mr8530263pls.149.1525775503446; Tue, 08 May 2018 03:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525775503; cv=none; d=google.com; s=arc-20160816; b=S7Q5W4uNl4xZGTplgLCOs3ufunfb3cCrMAtYWe/ZYS0SW6/ArcZBQHbIoASlUFRLbv aFb5Fjxsgr1HZQsiMynPLRA0C+5Gcz1f6J7X9i8/XfLXCYqU7xKz/JTkQTYYoZ6e6yps D0J0osSsXhGN7KNRVy17o8JZfETlFrnDkC8nFjpFIaKGEVR9WBCgVd/FLsI76KEsM13f AQzkDSL+micXxtzL0ekI3FXcZWeZMX7IXijMgD4oPqIWEFXTDgRUDvrw/gHzxtqlESWA ZveXv6vjIM3o8w+Zy900USWrCleQrdbWXpjRyJoaf8CxU9Tyzs1ELGulTRxQEYX7C+u8 1TXQ== 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=GDnBqBgogobKVsXm6RXonAl87c5wMQ+xTyo2q7Wub0A=; b=ZetfQIsQTgvtUPV+YD8tHm+VAFfdk14R3brnVc6BqRsouT1oh1VVWa8fVgtlJQ2h6a 5Aw012c0gWsJihNGwHfFezArSpOfBHxc03az1Cz1DEZnqeCF6jDlN5jlWflVDs3Grldl DE2CpY28hdhQfyKlSWO3yUG/+RSOYiYetuGn7jNAwU2qRjfTgQ3Olp2AMdXcdib7U67L rQZ1CMakCBzZ26TsqW5T9SdkNjShYI5t5XyNbIRve2SNtJMQFL2WfDelS6Ea9xS0Me/w wF6ZyNFYZmhXFFG5yfqEdeDHa3ZGRO/BxFwSoWICaCRAx3Qd92O1ic6bipzrsks7ZvVl rkWQ== 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 w65si24162723pfa.18.2018.05.08.03.31.42; Tue, 08 May 2018 03:31:43 -0700 (PDT) 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 S932236AbeEHKbC (ORCPT + 29 others); Tue, 8 May 2018 06:31:02 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7240 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754460AbeEHKa7 (ORCPT ); Tue, 8 May 2018 06:30:59 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 41DF04446709D; Tue, 8 May 2018 18:30:46 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Tue, 8 May 2018 18:30:40 +0800 From: John Garry To: , , , CC: , , , , , , , John Garry Subject: [PATCH v2 3/3] HISI LPC: Add ACPI UART support Date: Tue, 8 May 2018 18:27:32 +0800 Message-ID: <1525775252-239214-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525775252-239214-1-git-send-email-john.garry@huawei.com> References: <1525775252-239214-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 On the Huawei D03 development board the system UART is the UART connected on the LPC bus. The profile for the device driver required for this HW is as follows: - platform driver - 16550 - ACPI support - polling mode support - IO space support In principle we should use the PNP driver (8250_dw.c) for 8250-devices with ACPI FW. However since this driver does not support PNP devices, and modifying the PNP core code to support it is not worth the effort, use the generic 8250 isa driver. For this, we setup the pdev platform data for the serial 8250 port. Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 1.9.1 diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index eb5b3fc..d5f8545 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #define DRV_NAME "hisi-lpc" @@ -493,6 +494,22 @@ static int hisi_lpc_acpi_probe(struct device *hostdev) .hid = "IPI0001", .name = "hisi-lpc-ipmi", }, + /* 8250-compatible uart */ + { + .hid = "HISI1031", + .name = "serial8250", + .pdata = (struct plat_serial8250_port []) { + { + .iobase = res->start, + .uartclk = 1843200, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF, + }, + {} + }, + .pdata_size = 2 * + sizeof(struct plat_serial8250_port), + }, {} };