From patchwork Fri Dec 9 16:26:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 31869 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp872641wrr; Fri, 9 Dec 2022 08:29:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf6gzK6KS0u7mRd3o4Isostt4X3e96Iv13phjG9qV7FB6D3ZcIPL7HitZ4ovZ5urh0Pxngpj X-Received: by 2002:a05:6a20:8f04:b0:a4:efdd:a9c0 with SMTP id b4-20020a056a208f0400b000a4efdda9c0mr11071666pzk.14.1670603385745; Fri, 09 Dec 2022 08:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670603385; cv=none; d=google.com; s=arc-20160816; b=S2aGbBaZcNZWC8KpOk2ByEEz2bQV2MDqAyUD9nYPaFE+pFVa9x4MPmssjiYTLJ2lAp WWjOVCaakved24elUv18ZumM8ritM7if/1VjGSL+bkJPzUKBZX7wrK/LbRlxicvIhpec JazuReQb6ndWmAc58Uhu7d0eFMy3KjrKmA5KKIMaK/2gPEnkxQcmhF4u7/iu+P0uYLlk ki8CaVww8rib9y8T+2QXi9lnVS7eq/s7bDtzbMLv2iwmZpVw+sX4VBoJrOOoOZ159xRm wo1hNVgkqI5BpMqp/c6HrFtifjlrugWVwZgXeEkk1Q+I/AXVvU8mvurOEwkqt8d7iaLk gGdw== 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=LET7+BVLD7u2mz2p/Z3V+N5nYBkLwsfyiST0eTO7hzc=; b=zQjN5vfjfo1MFObYJXCyO4VoMX65xGsyUiqqBjGtRbUpqZsjxCnloth1I2RnBVN523 6GmTXF2lDCKHTDAHQRntRhLB8uh12h2NFuFL9UHUYxkGP5LMD/DP2Y1nCLLga9DBCakY 8hUcDBh3w/ixjXgUQnBGG8Ln1mBqFZ4/t9KSp5PPVrAlJD77y6pL+8sI7PCPf7nkFL7J EIUFB1Oo0BOIWsE5AslbvCqMLOq6BnU3sQgAZ2dSXvKsAOl1o6SExORQdD9b8vZwqfrU bTy8mE8b1iHr809AXBEJWM8/TeCTc0UFoT3Ph/OukaxSCTsAf6LI/DwgWNStcPNqbQPy u0dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NDNMKLLD; 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 d24-20020a17090ab31800b00213193e7047si1958071pjr.185.2022.12.09.08.29.24; Fri, 09 Dec 2022 08:29:45 -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=NDNMKLLD; 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 S229759AbiLIQ0j (ORCPT + 99 others); Fri, 9 Dec 2022 11:26:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbiLIQ0b (ORCPT ); Fri, 9 Dec 2022 11:26:31 -0500 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F32486F5A for ; Fri, 9 Dec 2022 08:26:30 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id x12so147225ilg.1 for ; Fri, 09 Dec 2022 08:26:30 -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=LET7+BVLD7u2mz2p/Z3V+N5nYBkLwsfyiST0eTO7hzc=; b=NDNMKLLDBAWf3MbF+6zPgovX77wTaVAyPMqg01VPkudPh14T1CwOao5Z19mx2+2xV7 FTo99ZqyJQ83ny1hGx7ubIC4VplT5IlyRzD4g+UjgtMNKneXVSelvMsYF6GYqUyu48hU iJz/SJ0ywZgJyvxcUzTBEYtGf8wooFhu7IDSs= 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=LET7+BVLD7u2mz2p/Z3V+N5nYBkLwsfyiST0eTO7hzc=; b=esXlpaABUe7RF1X83D+ElMxZtYkk/vvXYMo7VJebrTcKImzYVqsSGZ4Ao3YQZ3Bsw0 BYWEWPCQlPZ46eTOh3F2NiDtChKy2Hc0sgEsMZPB5OtMM/t1fKhBB0tgMOouctBjFz0l h1/6j0/RrLhi63wVubwqngb7A/FwN5AlhMntztrnpYLNogzw9JYUFUkqp1KUHAFhcdt9 w8KC5kWFCdNMBJecXFSOZWNQuLxRNUOQlh6rN0VhuzuJxGV++4op2livaos7P5I70rWU 7tfuQo6qMPft4Pz4TDTBHbPvRKRj9hWw2JeYsj7CHdUfdrqNDu2EKAWm/M4rEganwsjp nkgA== X-Gm-Message-State: ANoB5pneL7kHta1Y98UTF6k4b6h/5olPpw7aPx+BDsUVsa9k3Q1YHhiL ZM7u6jnwEqp1Pn1gqDJ56GUikgjPt5p19HhT X-Received: by 2002:a92:d9ce:0:b0:303:2f20:1a05 with SMTP id n14-20020a92d9ce000000b003032f201a05mr3535629ilq.24.1670603189613; Fri, 09 Dec 2022 08:26:29 -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 b2-20020a92dcc2000000b002e85e8b8d1dsm556531ilr.5.2022.12.09.08.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 08:26:29 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: Raul Rangel , Bhanu Prakash Maiya , Mark Hasemeyer , Prashant Malani , Benson Leung , Guenter Roeck , Tzung-Bi Shih , chrome-platform@lists.linux.dev Subject: [PATCH v12 3/3] platform/chrome: cros_ec_uart: Add DT enumeration support Date: Fri, 9 Dec 2022 09:26:24 -0700 Message-Id: <20221209092619.v12.3.Ie23c217d69ff25d7354db942613f143bbc8ef891@changeid> X-Mailer: git-send-email 2.39.0.rc1.256.g54fd8350bd-goog In-Reply-To: <20221209092619.v12.1.If7926fcbad397bc6990dd725690229bed403948c@changeid> References: <20221209092619.v12.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?1751754615571958828?= X-GMAIL-MSGID: =?utf-8?q?1751754615571958828?= 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 Reviewed-by: Prashant Malani --- Changes in v12: - Add Reviewed-by: Prashant Malani Changes in v11: - No change 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 43a7493347a59..bf0c291914725 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 @@ -326,6 +327,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 }, @@ -339,6 +346,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,