From patchwork Wed Dec 7 17:40:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 30965 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp321807wrr; Wed, 7 Dec 2022 09:47:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GcZuCtJZCtXyu4KiXvIVCPyYol5KTZPurUSfxFepR3z7LpWD9sZcUaC1yTmxXJI61XN9M X-Received: by 2002:a17:906:8c4:b0:7ae:fbe6:e7ca with SMTP id o4-20020a17090608c400b007aefbe6e7camr78463964eje.408.1670435251853; Wed, 07 Dec 2022 09:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670435251; cv=none; d=google.com; s=arc-20160816; b=L/zVLhS12PlHw6OmGShxzSc8BYq7UI0qhUI6k5/Ym56BAb+3YfHO52rwHuCXDhKIXE 8gDDP9sXzCylnWtz8zEgo6M7r+K5yT4Mu9tSZYHjAE2mUl2PPUtOcL5JzJeQNW7k8CnC ZmcJGh7pcrGPUhR8zOwDo0FlU8zh+bgHdbwwlMa7akgSQtXrrvmzdFJHKKCF8y8Bphff 2cFtSTdPXOxboI61Lf2tvG0DW9ebTZWpHeVR0MTVjfV9mVEAFojcsAT+cGeCLqPpxShY I+dWB76nBSUnUB402wYA6+EMdAYj7cvwIjhkMOhkpsfg5Bzup/w0abRuSn9iEZPazUG0 +53Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7AOuwreGgWBZ48meXtIQ/os+4XBQo160kH7z5x79khw=; b=dDnJ8S2Vi9nIOKCRU9UjC8QDMj9RY3WODuQ1bJRbI6jg2CnA0l5Qb+nCDWdw3X457G j1YdbZaJmADvEnqK3B0eJiszu+T5pZoq9yKNMHw8MT6BzDO47QOMAb+613MHQ0P6MHvA 6mutyJ6EcPTvufaL7UACcL+4hg1t//L1ier3BdI5hXsxzpNicPF4JV4VZXxz4hl7EsdJ kelIbFeNfhsmIGXIeNn4tf9OYSAS6m5Q7JnKwbpysLThC/6PHiSxCEQ24Bc7STwoll6r Asx/6pzwxmomaszXgruo7QuXTnMwgP+zFuc3kdIQ7eKe0olqWS8TT25agiJyR2gceaqy LR1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Dvdm7agX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a17090699c500b007c0fa8181c3si7769435ejn.454.2022.12.07.09.47.08; Wed, 07 Dec 2022 09:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Dvdm7agX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229992AbiLGRkg (ORCPT + 99 others); Wed, 7 Dec 2022 12:40:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbiLGRk1 (ORCPT ); Wed, 7 Dec 2022 12:40:27 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B176117F for ; Wed, 7 Dec 2022 09:40:26 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id n63so7778509iod.7 for ; Wed, 07 Dec 2022 09:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7AOuwreGgWBZ48meXtIQ/os+4XBQo160kH7z5x79khw=; b=Dvdm7agXaDNguMbyo8u06WGXNm5xdcejs53tMqoSM1hVGgY7grIWQi8iVqYbnpaH+7 WawsM41ZigZLSk6Z+KW1GuIaH+1xDAsRadTt7uHosDdvlL2IPXvRKnQA+XsOT9q5jSQ4 dkJhrcv+qGK4bKW20aG9/0lcZdZUsi1kK+tCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7AOuwreGgWBZ48meXtIQ/os+4XBQo160kH7z5x79khw=; b=TArpmhI8x6yoAgVIN/JKAhdOTwdoFlMh8W0GxQby/Fn3Bd+XF9fjhPrIk9jxZfrsGm zXNLBG/spmv1VRfQwFHm79bPV1Af4+B090TWIReUVFEKc3r3oIMFz0yYGdTMeKNpvK+Y IXhVvcqdyP4vT8eX3dMLGKx/0uCXuT/L9IMxMYY6N/8B3z0cAyx7xlxI5WnteIEcC1ac tdvehnVyQtfjx+N1yjGcqWAyzBq95WswMS6aDQ9vq4OvVj8i+8VI4zkkidOaGDv+eQVT 7izSexKF86r/4YTooZc1mLFp2hjsDGgVmfZVIuInSYXifVytAtka3TUHqIJi2qkXecmY QnXA== X-Gm-Message-State: ANoB5plhw1RQar06zWTQW/huoj4F48jVLp7WkbG54mq3KI9lf1wVOk45 IvMeSiQoycPfXL98Q4nwKqD8w5KTw0vfITsM X-Received: by 2002:a05:6602:4145:b0:6e0:992:d816 with SMTP id bv5-20020a056602414500b006e00992d816mr7112996iob.77.1670434825527; Wed, 07 Dec 2022 09:40:25 -0800 (PST) Received: from markhas1.roam.corp.google.com (63-225-246-100.hlrn.qwest.net. [63.225.246.100]) by smtp.gmail.com with ESMTPSA id q18-20020a920512000000b0030341bffab8sm32782ile.31.2022.12.07.09.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 09:40:25 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: Raul Rangel , Bhanu Prakash Maiya , Mark Hasemeyer , Benson Leung , Guenter Roeck , Tzung-Bi Shih , chrome-platform@lists.linux.dev Subject: [PATCH v10 3/3] platform/chrome: cros_ec_uart: Add DT enumeration support Date: Wed, 7 Dec 2022 10:40:13 -0700 Message-Id: <20221207104005.v10.3.Ie23c217d69ff25d7354db942613f143bbc8ef891@changeid> X-Mailer: git-send-email 2.39.0.rc1.256.g54fd8350bd-goog In-Reply-To: <20221207104005.v10.1.If7926fcbad397bc6990dd725690229bed403948c@changeid> References: <20221207104005.v10.1.If7926fcbad397bc6990dd725690229bed403948c@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751578314826732756?= X-GMAIL-MSGID: =?utf-8?q?1751578314826732756?= From: Bhanu Prakash Maiya Existing firmware uses the "PRP0001" _HID and an associated compatible string to enumerate the cros_ec_uart. Add DT enumeration support for already shipped firmware. Signed-off-by: Bhanu Prakash Maiya Co-developed-by: Mark Hasemeyer Signed-off-by: Mark Hasemeyer --- Changes in v10: - No change Changes in v9: - Rebase onto for-next - Update authorship Changes in v8: - No change Changes in v7: - Move PRP0001 enumeration support to its own commit drivers/platform/chrome/cros_ec_uart.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/platform/chrome/cros_ec_uart.c b/drivers/platform/chrome/cros_ec_uart.c index 873aee4172bfd..70e337717508a 100644 --- a/drivers/platform/chrome/cros_ec_uart.c +++ b/drivers/platform/chrome/cros_ec_uart.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -332,6 +333,12 @@ static int __maybe_unused cros_ec_uart_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(cros_ec_uart_pm_ops, cros_ec_uart_suspend, cros_ec_uart_resume); +static const struct of_device_id cros_ec_uart_of_match[] = { + { .compatible = "google,cros-ec-uart" }, + {} +}; +MODULE_DEVICE_TABLE(of, cros_ec_uart_of_match); + #ifdef CONFIG_ACPI static const struct acpi_device_id cros_ec_uart_acpi_id[] = { { "GOOG0019", 0 } @@ -344,6 +351,7 @@ static struct serdev_device_driver cros_ec_uart_driver = { .driver = { .name = "cros-ec-uart", .acpi_match_table = ACPI_PTR(cros_ec_uart_acpi_id), + .of_match_table = cros_ec_uart_of_match, .pm = &cros_ec_uart_pm_ops, }, .probe = cros_ec_uart_probe,