From patchwork Mon Oct 26 17:57:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishnav M A X-Patchwork-Id: 287321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35BA2C4363A for ; Mon, 26 Oct 2020 17:57:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E17BF2231B for ; Mon, 26 Oct 2020 17:57:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="PkU3mM+7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1788890AbgJZR5z (ORCPT ); Mon, 26 Oct 2020 13:57:55 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41346 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788884AbgJZR5z (ORCPT ); Mon, 26 Oct 2020 13:57:55 -0400 Received: by mail-pl1-f193.google.com with SMTP id w11so5087313pll.8 for ; Mon, 26 Oct 2020 10:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zdwZb/8vCueVng7uQfENP1wxUMwC84r+n6kRBBfDO4Q=; b=PkU3mM+7LhxcJsnVDtuswZz3ooy1YfPd53qjZhfQIiK8SaHwOgpKYba/oaddGT/tlr hPAaX7h/uY/L35GsAnIINjyHIEYO+3+betYb9yJkZsbV+ZV+wUoCjVOT893SI8GcsSbo J2ynmE2XWlH/gmjv1iu/Mib/6rWNjn1cSSyy5Spoxk9rZe7yl3XD84d1N+gcNm4Tx1j6 zBKxK7GIdtkQpdTA/9k3M41VGcKz+leq+ybkvrxi7TmAK8aNcK781TDj70Lc6hutc0W3 oyCrcLwhBzGCemlZdby8rj1zuv1VHa1RLqZEyiddD7br1bMBp/vlLYI/8JltlsvBp33V lyfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zdwZb/8vCueVng7uQfENP1wxUMwC84r+n6kRBBfDO4Q=; b=qbZJxUnhEFEklMRIRhxcdRjtBYxjdKSD06xUIUU5QvIPvMWYsUkEJkQnqr+tC2LsyR 774x6DemRhJfi2V211RL4skCJEoTpxDTJfwQztP3AScR8RpQCJNfChAhecGnobSJlKOo 3nD2/+ay5h6beWuxQU1nV9l4qIqRnITpsvNz18WRKDoONZFKD7BzyQgXvEBCAbz8B68J /SZtXkM5H+MdRBkOwPp4A9CtAQKZN2P5nzNkUX5+5SsoGW+yAfO/bYBw+i65jENR1j8V aAyqPJ9AL7RHdOQTFmxrqUAm9wwzHaY4c22dmo/PQsaXHfUo3Bluz7pjTj44GryixHvp tpXQ== X-Gm-Message-State: AOAM530uWRuRnNu3tZJ6sOFPdoZS6HJUPtH0kMkJPDae9Kgt2ZAfEsAz NqjzeRa6Z+3iXIC18xaoKhvKrEvr4f9FZBQ= X-Google-Smtp-Source: ABdhPJzyMepZDH89Xdy7E0fgsxyQn6K95GUGdr73fKNwZk6Z1CBEWb1cQpviZhBAwniC4A/ngeoqbw== X-Received: by 2002:a17:902:a503:b029:d6:d9d:f901 with SMTP id s3-20020a170902a503b02900d60d9df901mr11404419plq.54.1603735073836; Mon, 26 Oct 2020 10:57:53 -0700 (PDT) Received: from localhost.localdomain ([116.68.74.56]) by smtp.gmail.com with ESMTPSA id o65sm11583088pga.42.2020.10.26.10.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:57:53 -0700 (PDT) From: Vaishnav M A To: johan@kernel.org Cc: ribalda@kernel.org, robh@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, masahiroy@kernel.org, andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-kbuild@vger.kernel.org, jkridner@beagleboard.org, drew@beagleboard.org, robertcnelson@beagleboard.org, vaishnav@beagleboard.org Subject: [RFC PATCH 1/5] serdev: Add serdev_device_id Date: Mon, 26 Oct 2020 23:27:14 +0530 Message-Id: <20201026175718.965773-2-vaishnav@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026175718.965773-1-vaishnav@beagleboard.org> References: <20201026175718.965773-1-vaishnav@beagleboard.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Currently,a serdev device driver can only be used with devices that are nodes of a device tree, or are part of the ACPI table.id_table will be used for devices that are not part of the device tree nor the ACPI table (example: device on greybus gbphy created uart). corresponding modalias field is introduced to name the driver to be used with the device, required for device(s) that are neither described by device tree nor ACPI table.serdev_device_uevent is also extended for modalias devices. Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Vaishnav M A --- drivers/tty/serdev/core.c | 41 ++++++++++++++++++++++++++++----- include/linux/mod_devicetable.h | 10 ++++++++ include/linux/serdev.h | 3 +++ 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index c5f0d936b003..01b248fdc264 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -27,12 +27,17 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { int len; + struct serdev_device *serdev = to_serdev_device(dev); len = acpi_device_modalias(dev, buf, PAGE_SIZE - 1); if (len != -ENODEV) return len; - return of_device_modalias(dev, buf, PAGE_SIZE); + len = of_device_modalias(dev, buf, PAGE_SIZE); + if (len != -ENODEV) + return len; + + return sprintf(buf, "%s%s\n", SERDEV_MODULE_PREFIX, serdev->modalias); } static DEVICE_ATTR_RO(modalias); @@ -45,14 +50,18 @@ ATTRIBUTE_GROUPS(serdev_device); static int serdev_device_uevent(struct device *dev, struct kobj_uevent_env *env) { int rc; - - /* TODO: platform modalias */ + struct serdev_device *serdev = to_serdev_device(dev); rc = acpi_device_uevent_modalias(dev, env); if (rc != -ENODEV) return rc; - return of_device_uevent_modalias(dev, env); + rc = of_device_uevent_modalias(dev, env); + if (rc != -ENODEV) + return rc; + + return add_uevent_var(env, "MODALIAS=%s%s", SERDEV_MODULE_PREFIX, + serdev->modalias); } static void serdev_device_release(struct device *dev) @@ -83,16 +92,36 @@ static const struct device_type serdev_ctrl_type = { .release = serdev_ctrl_release, }; +static int serdev_match_id(const struct serdev_device_id *id, + const struct serdev_device *sdev) +{ + while (id->name[0]) { + if (!strcmp(sdev->modalias, id->name)) + return 1; + id++; + } + + return 0; +} + static int serdev_device_match(struct device *dev, struct device_driver *drv) { + const struct serdev_device *sdev = to_serdev_device(dev); + const struct serdev_device_driver *sdrv = to_serdev_device_driver(drv); + if (!is_serdev_device(dev)) return 0; - /* TODO: platform matching */ if (acpi_driver_match_device(dev, drv)) return 1; - return of_driver_match_device(dev, drv); + if (of_driver_match_device(dev, drv)) + return 1; + + if (sdrv->id_table) + return serdev_match_id(sdrv->id_table, sdev); + + return strcmp(sdev->modalias, drv->name) == 0; } /** diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 5b08a473cdba..656353952da2 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -486,6 +486,16 @@ struct i3c_device_id { const void *data; }; +/* serdev */ + +#define SERDEV_NAME_SIZE 32 +#define SERDEV_MODULE_PREFIX "serdev:" + +struct serdev_device_id { + char name[SERDEV_NAME_SIZE]; + kernel_ulong_t driver_data; +}; + /* spi */ #define SPI_NAME_SIZE 32 diff --git a/include/linux/serdev.h b/include/linux/serdev.h index 9f14f9c12ec4..0d9c90a250b0 100644 --- a/include/linux/serdev.h +++ b/include/linux/serdev.h @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -45,6 +46,7 @@ struct serdev_device { const struct serdev_device_ops *ops; struct completion write_comp; struct mutex write_lock; + char modalias[SERDEV_NAME_SIZE]; }; static inline struct serdev_device *to_serdev_device(struct device *d) @@ -63,6 +65,7 @@ struct serdev_device_driver { struct device_driver driver; int (*probe)(struct serdev_device *); void (*remove)(struct serdev_device *); + const struct serdev_device_id *id_table; }; static inline struct serdev_device_driver *to_serdev_device_driver(struct device_driver *d) From patchwork Mon Oct 26 17:57:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishnav M A X-Patchwork-Id: 287320 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00F01C4363A for ; Mon, 26 Oct 2020 17:58:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B73D4222C8 for ; Mon, 26 Oct 2020 17:58:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="ZOOw+V2R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1781929AbgJZR6K (ORCPT ); Mon, 26 Oct 2020 13:58:10 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:46730 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1782200AbgJZR6J (ORCPT ); Mon, 26 Oct 2020 13:58:09 -0400 Received: by mail-pl1-f193.google.com with SMTP id x10so2835266plm.13 for ; Mon, 26 Oct 2020 10:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jVqFrGJ54qznF12EgJgnYEytgLpa/16deYrykuVS5Rk=; b=ZOOw+V2RHRZn8HxQIHaNmwEX9HGWCqhQ6DHV/MT0C3Rp3Amv/+2dZBRKec0rKvIx7d QOLN9EQ2s2Ve/eWQJZydilAgqLnLxN0OZls4cB+SxV6QEuUadkBlJ2nwI133LYHphuFU MAGSYY9jpJ+dMiWxWQ184HapvtHCF87KI2UQJFuZ4TxTXjmZVAKrD5/bPhD8ib+8UiPi SbrGzY3mvZyat/E6dGLrHxOrC0V3aY974cLwKvBBJix2xB57NUK+HT4K8Pdk09OoQ8wd FjIFQQ0RgTs6w8qpYhI7fBDtyi1jexSkkK019NqWZR6rWsr4qGrMciRNByssmjlmx374 Pu1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jVqFrGJ54qznF12EgJgnYEytgLpa/16deYrykuVS5Rk=; b=al7rALVSfRttxeEI7T/k5ho5FRLLKS1LqKTv4riBsRUY/LxfyQSCe/Gh92nSd3dDRb OaKyP2CVRCa9aGRwwTOuOj6ynZ8rOqJ/BPaCnOiICFuUZxMMqWAQFJ9QvyMDqk61xTHA +QvnN2HwZYaW/ZXJbwnJtovwc3VALHU2oAco2Na+OPhpPBsVX1jwE/Y1EtUWsscJvXUZ NSpR4lN3PabdiexO70rpwOUtt7oI8wVPnb/v2KYBsoy21r0XDDMlAr2ArBCmjIob11Yf VC2dTnFzIUFeZsFI2va8KNlvC1WTklq5oEnP1Z6/8g2y5eLPOafqOtdHthRDLhzXGfOY CUaA== X-Gm-Message-State: AOAM533gPAvYM0HzgjRILTAQDvAevlnug2YBF60o1aYA+xhMGPR9Pbb8 PVUZCvG3ZQyVonSu4deFPozr X-Google-Smtp-Source: ABdhPJzgATxazG66Vln/+4UlHaSHpaVSkUndwcviy4e28WWIsUcCoLM3wud9RK8Mjr2Ro4ZSZPzfug== X-Received: by 2002:a17:902:b70f:b029:d6:5bcb:1b24 with SMTP id d15-20020a170902b70fb02900d65bcb1b24mr181099pls.82.1603735088185; Mon, 26 Oct 2020 10:58:08 -0700 (PDT) Received: from localhost.localdomain ([116.68.74.56]) by smtp.gmail.com with ESMTPSA id o65sm11583088pga.42.2020.10.26.10.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:58:07 -0700 (PDT) From: Vaishnav M A To: johan@kernel.org Cc: ribalda@kernel.org, robh@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, masahiroy@kernel.org, andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-kbuild@vger.kernel.org, jkridner@beagleboard.org, drew@beagleboard.org, robertcnelson@beagleboard.org, vaishnav@beagleboard.org Subject: [RFC PATCH 3/5] serdev: add of_ helper to get serdev controller Date: Mon, 26 Oct 2020 23:27:16 +0530 Message-Id: <20201026175718.965773-4-vaishnav@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026175718.965773-1-vaishnav@beagleboard.org> References: <20201026175718.965773-1-vaishnav@beagleboard.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org add of_find_serdev_controller_by_node() to obtain a serdev_controller from the device_node, which can help if the serdev_device is not described over device tree and instantiation of the device happens later from a different driver, for the same purpose an option to not delete an empty serdev controller is added. Signed-off-by: Vaishnav M A --- drivers/tty/serdev/core.c | 17 +++++++++++++++++ include/linux/serdev.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 01b248fdc264..85977b36ed7f 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -582,6 +582,17 @@ static int of_serdev_register_devices(struct serdev_controller *ctrl) return 0; } +struct serdev_controller *of_find_serdev_controller_by_node(struct device_node *node) +{ + struct device *dev = bus_find_device_by_of_node(&serdev_bus_type, node); + + if (!dev) + return NULL; + + return (dev->type == &serdev_ctrl_type) ? to_serdev_controller(dev) : NULL; +} +EXPORT_SYMBOL_GPL(of_find_serdev_controller_by_node); + #ifdef CONFIG_ACPI #define SERDEV_ACPI_MAX_SCAN_DEPTH 32 @@ -779,6 +790,12 @@ int serdev_controller_add(struct serdev_controller *ctrl) pm_runtime_enable(&ctrl->dev); + /* provide option to not delete a serdev controller without devices + * if property is present + */ + if (device_property_present(&ctrl->dev, "force-empty-serdev-controller")) + return 0; + ret_of = of_serdev_register_devices(ctrl); ret_acpi = acpi_serdev_register_devices(ctrl); if (ret_of && ret_acpi) { diff --git a/include/linux/serdev.h b/include/linux/serdev.h index 0d9c90a250b0..2e1eb4d17e1b 100644 --- a/include/linux/serdev.h +++ b/include/linux/serdev.h @@ -115,6 +115,8 @@ static inline struct serdev_controller *to_serdev_controller(struct device *d) return container_of(d, struct serdev_controller, dev); } +struct serdev_controller *of_find_serdev_controller_by_node(struct device_node *node); + static inline void *serdev_device_get_drvdata(const struct serdev_device *serdev) { return dev_get_drvdata(&serdev->dev); From patchwork Mon Oct 26 17:57:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishnav M A X-Patchwork-Id: 287319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C70F2C388F9 for ; Mon, 26 Oct 2020 17:58:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 450162231B for ; Mon, 26 Oct 2020 17:58:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="CaGYb9fw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1782137AbgJZR6Y (ORCPT ); Mon, 26 Oct 2020 13:58:24 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33854 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788915AbgJZR6P (ORCPT ); Mon, 26 Oct 2020 13:58:15 -0400 Received: by mail-pg1-f196.google.com with SMTP id t14so6501311pgg.1 for ; Mon, 26 Oct 2020 10:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yo0mnlsSy3YgKGeUG02IRLcGcjRgZwwdFoj2NxiD5lI=; b=CaGYb9fwKX1t4/s7hL5McQiJsJosjdSgPtgRrXcOVEv9geNhsgv06QlYZxq9MmypsM 8h2YGCwMDt5AFwQAVzFT9qgQDYt93HasEwsXY9F8AWf+nt41cl4k+rKcfknOH1hgOUks iNyNuzmEHIavPzF4GUjUo8btX9rmkJo7bx1Jo0qClUL2fxlqB+etlyZ4ygfoXJfgOFf9 y30GRFWWH1aR0AL5e2Pe/R/+yhSkRAj3Lbcg95C8vcfqdWrthKHcBeF1axLUW5Gif+CD hUtko2x5J+g2cgiNr/cDNfys9Pg7rqVVOYO4UtgMHH7GZZmOPI9vgSEoW/ddjc6QnUcs PgnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yo0mnlsSy3YgKGeUG02IRLcGcjRgZwwdFoj2NxiD5lI=; b=Q83Z88pOotL9Gcy71jPLuUuAp/yqcVu+5RQ8mfpu7U9XgjC7pA97IuSPRdzSTwjsqc nJ+CRj8oVUqI6XT55mvxr5+xF5OktIRXVn2uMEOogKBhh5MN5P2E9Nm7kpmrdUfqtB70 xns93bXMI98iJB/qpQceLoJybz291hpHhX6g1gDcY8T40QLmT5cYFyyar9+aJRCbgISh 6BSkbntNcvdESsQcxkwHU8DNfaz6QKhOlALT13eY5C99eUR3NySQG2BItPEONWfnkc1X cyGBJ5lBB5X4rEo79dq1G+7TNjaGrek6eqKxhaFDOc0kNBfXk2tQk5YjB8NqYk+CnEei 6B2Q== X-Gm-Message-State: AOAM532dUJOaJmXcu6eWS5rsMuawYYM2xIv+TV+u4kGqwq7w2JnD7IrE bMBfrj+BddE4CEIHb4cscFW3 X-Google-Smtp-Source: ABdhPJyKADO7GsN5K7F28og4HF+KdQfGGrByPskuE8rwr33F4aFXWfsWuMVwDc84lw/9USAHHy9q7A== X-Received: by 2002:a63:3e0a:: with SMTP id l10mr12627239pga.420.1603735094882; Mon, 26 Oct 2020 10:58:14 -0700 (PDT) Received: from localhost.localdomain ([116.68.74.56]) by smtp.gmail.com with ESMTPSA id o65sm11583088pga.42.2020.10.26.10.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:58:14 -0700 (PDT) From: Vaishnav M A To: johan@kernel.org Cc: ribalda@kernel.org, robh@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, masahiroy@kernel.org, andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-kbuild@vger.kernel.org, jkridner@beagleboard.org, drew@beagleboard.org, robertcnelson@beagleboard.org, vaishnav@beagleboard.org Subject: [RFC PATCH 4/5] gnss: ubx add MODULE_DEVICE_TABLE(serdev) Date: Mon, 26 Oct 2020 23:27:17 +0530 Message-Id: <20201026175718.965773-5-vaishnav@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026175718.965773-1-vaishnav@beagleboard.org> References: <20201026175718.965773-1-vaishnav@beagleboard.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org export serdev id table to the module header. Signed-off-by: Vaishnav M A --- drivers/gnss/ubx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c index 7b05bc40532e..e50056cc4223 100644 --- a/drivers/gnss/ubx.c +++ b/drivers/gnss/ubx.c @@ -138,6 +138,14 @@ static const struct of_device_id ubx_of_match[] = { MODULE_DEVICE_TABLE(of, ubx_of_match); #endif +static const struct serdev_device_id ubx_serdev_id[] = { + { "neo-6m", }, + { "neo-8", }, + { "neo-m8", }, + {} +}; +MODULE_DEVICE_TABLE(serdev, ubx_serdev_id); + static struct serdev_device_driver ubx_driver = { .driver = { .name = "gnss-ubx", @@ -146,6 +154,7 @@ static struct serdev_device_driver ubx_driver = { }, .probe = ubx_probe, .remove = ubx_remove, + .id_table = ubx_serdev_id, }; module_serdev_device_driver(ubx_driver);