Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp284853iof; Mon, 6 Jun 2022 03:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvEkEUEK9gSuWAhyttM2gm5bls6sKyl/kFGrb+Vo1o+peHkv/j+6fF0sMoiKdyrzCJfln1 X-Received: by 2002:a63:475d:0:b0:3fc:b414:f2aa with SMTP id w29-20020a63475d000000b003fcb414f2aamr20362220pgk.17.1654511508489; Mon, 06 Jun 2022 03:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654511508; cv=none; d=google.com; s=arc-20160816; b=HmyuOPocSlvrFWgkj1HfHxPA/2x9BbfmUvaWPXqueIIVcdnKJYDdMtgyQOjYmm5KZd fF/HvMeSwqy8NeBhjT8vAs2O9eCXKx8Fqe+uRb8+3g8kN3XpOQSio2PTRDsch3wNL2VP p8BMaMTkWd7GnpvIT4h8zSETmtbIpWPfP9eHf2PShwsrvIRcFNl/bvB10z77vlGAREgL zwvPKPXupjZ75EUMYi5S+SO1ffl11SpvF14fAULzRDvAL+BMRSwm1wH51ri4WobcmZyh wtJTUffESkJMl2L7NpC/2JkllwTGjpt7PLRZ9x5Jffm/gYmwqRMBiFIeSx9EfgFDDP+O 2gqw== 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=BTJ3BsPgAyEXjQg5zxZhXs7W84LgpvVyO7TtvomeXUI=; b=PrTY42hUPg6JxtOKIfzoPddw7gfEI27hpeIn42BkLc88A9wk8C29NxSpLLqhAQrMr9 n8tHJNPKdQSPimemu9Fhdex1AWsBLstmNhoGYFj6MWzmIV4FkIG3HNii8+c+M6+DDtQy RioDSxr3Cl5cNjidgKN+1PpEiyJXwHXpLPK1oBNU4fEDLBDW7CBh0XmJppxWa2pXLnsT omuI2EjXm18owp3/PmHENfjKxYV8cwBFFbnXGhQHrpNHDeaMMJReWQOZvL3qjQQ89v1h vLTG5viPqyDr1ac7pybamHz6K2zwCzvDUo9J2XY/3F8qlixSRJVgNm5gbwh0a9wYj9K7 6HRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VN5mTF4U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g32-20020a635220000000b003fadd961503si19061294pgb.865.2022.06.06.03.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 03:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VN5mTF4U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3CA4C17127A; Mon, 6 Jun 2022 03:09:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233773AbiFFKIG (ORCPT + 99 others); Mon, 6 Jun 2022 06:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233462AbiFFKGD (ORCPT ); Mon, 6 Jun 2022 06:06:03 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3261128C2C; Mon, 6 Jun 2022 03:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654509951; x=1686045951; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S3gDlxKOTB6cNszyQehsU3Wkz7UsMQbXrzXb2KIgEfU=; b=VN5mTF4UczqR+iuDwFRsQL79FdxOThp9BmshVAmyF16nGr3koUE7Gjqf GbC865z7PAEgSIEdKptrsIW4KS0XmEAj+kZtpX7/NGKoqWE+OCwormabm gHn/AjtyGn1daVakk2z6EiEtB1FcixPg/gJFgRJH9QyNrQ+p/2OoGAYNH U3KMdp0jS+lI1o/QBKiLFKZGEyMVwllHe9naFt6IinQaUIqTanCVn/KWC 6xwcI60dqkKuWO+TRgxf3rdaMKS5WgnPtLAOMo4L15+0faZj7H3N8UhSu 587FwYjKQFLdRZu7AZfSwqZHiMGpuXzfRSfjolKoYtf4Zu/zgBXK1D2e3 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="362987068" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="362987068" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 03:05:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635523780" Received: from amkossek-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.57.11]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 03:05:50 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 20/36] serial: sc16is7xx: Fill in rs485_supported Date: Mon, 6 Jun 2022 13:04:17 +0300 Message-Id: <20220606100433.13793-21-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220606100433.13793-1-ilpo.jarvinen@linux.intel.com> References: <20220606100433.13793-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Add information on supported serial_rs485 features. This driver does not support delay_rts_after_send but the pre-existing behavior is to return -EINVAL if delay_rts_after_send is non-zero. In contrast, other drivers that do not support delay_rts_after_send either zero delay_rts_after_send or do not care (leave the inaccurate value). As changing this would cause userspace visible impact, the change is not attempted here. But perhaps it should be still tried (maybe nobody finds that kind of API oddity significant)? Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/sc16is7xx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 8472bf70477c..b3162dfe97b1 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1354,6 +1354,12 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip, } #endif +static const struct serial_rs485 sc16is7xx_rs485_supported = { + .flags = SER_RS485_ENABLED | SER_RS485_RTS_AFTER_SEND, + .delay_rts_before_send = 1, + .delay_rts_after_send = 1, /* Not supported but keep returning -EINVAL */ +}; + static int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype, struct regmap *regmap, int irq) @@ -1456,6 +1462,7 @@ static int sc16is7xx_probe(struct device *dev, s->p[i].port.iotype = UPIO_PORT; s->p[i].port.uartclk = freq; s->p[i].port.rs485_config = sc16is7xx_config_rs485; + s->p[i].port.rs485_supported = &sc16is7xx_rs485_supported; s->p[i].port.ops = &sc16is7xx_ops; s->p[i].old_mctrl = 0; s->p[i].port.line = sc16is7xx_alloc_line(); -- 2.30.2