Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp284713iof; Mon, 6 Jun 2022 03:31:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE31ud050vvXrp0nICeBMeX71RtyNL/2sxGH19bO/vCxroYK5y/VZQ1zC8qFfJ5q0syTO1 X-Received: by 2002:a63:9143:0:b0:3fc:52b8:401a with SMTP id l64-20020a639143000000b003fc52b8401amr20439500pge.401.1654511498156; Mon, 06 Jun 2022 03:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654511498; cv=none; d=google.com; s=arc-20160816; b=s7tg29BDloPf0oUBc+xcIvLu3KbpqEqZrAVoMWhCdL1Q3Zc3piIw3j3QcO2O1aV1mb PijR/nAaQ6hc250mbVUGz6gf2OAVqTa4SCl1xYF1XHMxGQXo+4/B5tPVZ4Xvmzp4HhYZ zENMi551L2LJZCJC+YhFP6vEVUMvdesNS9qvgTj4pW2m2X5OwUpV172U94ogGoBpu3B8 a8DJBz9/tV1/iIAP2gP7B/Y62KwhRqeN0FUVAugml9CfWcGyR1I9GcOtsao4GpiZ4zCv 1qa9yiN6YWYOPL+3P/TCqtg+2D/KfK0PL6kCiVFFZvi1fP/fUuN8uLtQU1zg596qqbIJ hltw== 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=HKH4H+8JTEF+PZNc3QnOPReuayLiAGNAn/2tb3ulmVQ=; b=ffhw03gFzKfyI4vzc/87RQniaKrgX+Eru8PAnNV46r4NyGJu8TkqI7yJDXPJYPmDxj W6vs9hhxfu0Qp/ZqEMb0aWLTHlzm7LnnOaZx7bezXcVSmXbyex+f27C99542ob1g/f5X 2dZ1dN1hrDn4XTRifJrGUQPoSlDVKj9u1n+bBLzl8CVszDZtJhCspGjctSXfQUmB7eOn Wu/RKG8u1C9lveX0XmrzN1FKfQgqLAzW7rgq5ybr9KTCmTvefo0x0ijnIdbPeBlrnGrU nAJTvi+4gyaQa5CfW95RLjY2Uxmu52TWk0R+UI1ReVnCe07DysmBpg+p4WJ+W1TNFonr mnSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=azvu6Vpl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id f65-20020a636a44000000b003fd97d4ed95si7233234pgc.0.2022.06.06.03.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 03:31:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=azvu6Vpl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 53E0B15E4A2; Mon, 6 Jun 2022 03:08:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233569AbiFFKHS (ORCPT + 99 others); Mon, 6 Jun 2022 06:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233332AbiFFKFl (ORCPT ); Mon, 6 Jun 2022 06:05:41 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 270BE64D0B; Mon, 6 Jun 2022 03:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654509935; x=1686045935; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aI/KgY4+B8Ci+VydAqA1rpLQE3wNHPRRmKH/bbm45dk=; b=azvu6Vpl08iHAE6WYq8mP4ZHUw6I5cvE4//luw8ibmxH9n6zu0CEPliC Xe59QqS1xWeZ49jjiH3ZG6DK4MlrGLK9rhNRyAWVQJqF8Hsph3r2HQz95 bce/kdIOsauV2PgCSjfMmfzMuJnkmMmI5XrgpP1tRQ5+XCDyAgTPTomXE 6CHM6RlW3gxQjfeo40f0ie4rSsRo+Au+xoHLqxKs3BG0QHbCk6aU/L3cT nz7nXFuq5ln2eN1GNJhA6D1zSivWYlNtiYPm7nbLWpxxXoF82mcrw7oBx y1Mvc+nSTj1zhsFaUVfkuxTgkkm2PZL01lX5+JbC0ib8dHErNALc1QLEn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="362987053" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="362987053" 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:30 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635523691" 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:28 -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 13/36] serial: ar933x: Fill in rs485_supported Date: Mon, 6 Jun 2022 13:04:10 +0300 Message-Id: <20220606100433.13793-14-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. In the case where RTS is lacking, RS485 cannot be enabled so provide zero rs485_supported for that case. Perhaps it would make sense to not provide rs485_config() at all in that case but such a change would have userspace visible impact/change in behavior so this patch does not attempt it. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/ar933x_uart.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index 6269dbf93546..ab2c5b2a1ce8 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -702,6 +702,11 @@ static struct uart_driver ar933x_uart_driver = { .cons = NULL, /* filled in runtime */ }; +static const struct serial_rs485 ar933x_no_rs485 = {}; +static const struct serial_rs485 ar933x_rs485_supported = { + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND, +}; + static int ar933x_uart_probe(struct platform_device *pdev) { struct ar933x_uart_port *up; @@ -773,6 +778,7 @@ static int ar933x_uart_probe(struct platform_device *pdev) port->fifosize = AR933X_UART_FIFO_SIZE; port->ops = &ar933x_uart_ops; port->rs485_config = ar933x_config_rs485; + port->rs485_supported = &ar933x_rs485_supported; baud = ar933x_uart_get_baud(port->uartclk, AR933X_UART_MAX_SCALE, 1); up->min_baud = max_t(unsigned int, baud, AR933X_UART_MIN_BAUD); @@ -796,6 +802,7 @@ static int ar933x_uart_probe(struct platform_device *pdev) !up->rts_gpiod) { dev_err(&pdev->dev, "lacking rts-gpio, disabling RS485\n"); port->rs485.flags &= ~SER_RS485_ENABLED; + port->rs485_supported = &ar933x_no_rs485; } #ifdef CONFIG_SERIAL_AR933X_CONSOLE -- 2.30.2