Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp282875iof; Mon, 6 Jun 2022 03:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycbsA+iBZ/s3eW7+LOUwFon1y4K3qTC6hnElXSFvjo24fG5Nx9VCFJeZNVx0NIRDDZfYyt X-Received: by 2002:a17:902:efc6:b0:167:8177:60a7 with SMTP id ja6-20020a170902efc600b00167817760a7mr3757116plb.110.1654511356692; Mon, 06 Jun 2022 03:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654511356; cv=none; d=google.com; s=arc-20160816; b=FDsfdC3Y35PPWy8qT6mkfHg7l6ikRAYwPIDFhqww1qJ2lOMk9wD+TRpytK7aczASE1 8nr9n4tpDDaz3iWvGT6q+G0ZuiI2o6VFy4tMFuBoFEHNUYhYVs2LyCaA1HZLIBk0TDRm KJEmavchOI+44uwYcTSBUDHL10dR3zx5Is2FQ0x/vDjQ210nW48vRdYbkdkzRhM/t4xO k9H9WUlfSRkTDh1SVj/CrtBsVmr5hQsjefHz/rhm4QVoR0LQmq17zH3YKC6kAbzbeRs1 u1i2yE5tsYU7uyNGTGch/fLHL3wLO4jqMTmIXx0dMShVJF+B76Y2cQ+PP8dI0eXtECGG dsLw== 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=25zz9cEleOcIggO8t6p4q3Yv47g0LJ06CR+6+eqp3Ew=; b=QbxqvH5jS2M2m2oroHiMsLkS48+bxPbBOZT6N9bpuJB1Bk5EtpiTOdqLSPe38IzwuW T1T9v56vxfcZD0gbtLkq6M7EAVPVXtBCs5Txsc5pOBI27f3HdMVQ2lxMyRWrI59lo5u2 OIuqAY+O2JhAxA+7NXAfe7pzNZsVnqKqLFuJonMQDjk7wMRSptq4jOZETBDBeRZCahoW jmK3gluj83z1Kd28ZSbzCtps8E4kbhx5dIEWUFLE46/nLyghtTZ4DNqDAA0M3UdKlxJa MPvNkv4Tp+n49bcw6sNSR4QD1smUsnCCTrZE90Ge2r0kHOXYuKyC738mcfSN2KM1a4Zi ZVCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RxpNUNL1; 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 c11-20020a170903234b00b00164420193a0si22105544plh.404.2022.06.06.03.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 03:29:16 -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=RxpNUNL1; 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 6EC2E12D12; Mon, 6 Jun 2022 03:07:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233521AbiFFKGi (ORCPT + 99 others); Mon, 6 Jun 2022 06:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233299AbiFFKFe (ORCPT ); Mon, 6 Jun 2022 06:05:34 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11E6C703F8; Mon, 6 Jun 2022 03:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654509933; x=1686045933; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=45ZGB+Mt9hakBvLDZWBXID2+gQ0mP+GP7HtxatKCn3U=; b=RxpNUNL15K5rIEzbb9RLZpSnC+J4vHykTwx8vrbN8iOKEn1qjil7bGgf mlQdL9M19b7yhxbyxqUw+DYuxkUw0FWNtUk864jDP3BbcyHt8Zr8xpEv4 OgHd7V8R4Pdq09u+0N7VJV+cFsT8zmFESSk/rwZp5ohxDopUxXjpWCUkV SZMtJwQy1MYAYJK3BK8HIovumhoeKIx733hH0fu7oJpz7AuDZ4GM9FAY+ +kmTFUMtLHJPjq671LM8b+XCZGNdVuYh1kAZHxs4VZfz4ttAF+f/kr+BP nmZb1Z4RQ5ZSqD3degdJMA5rxSyeJHOCuE8c+JBjkFbrG2NA5iwKRjmJ5 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="362987043" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="362987043" 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:16 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635523593" 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:14 -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 08/36] serial: 8250_fintek: Fill in rs485_supported Date: Mon, 6 Jun 2022 13:04:05 +0300 Message-Id: <20220606100433.13793-9-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. Differentiate based on which port is in question. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/8250/8250_fintek.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index dba5950b8d0e..6e98c376e082 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -424,6 +424,17 @@ static int probe_setup_port(struct fintek_8250 *pdata, return -ENODEV; } +/* Only the first port supports delays */ +static const struct serial_rs485 fintek_8250_rs485_supported_port0 = { + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND, + .delay_rts_before_send = 1, + .delay_rts_after_send = 1, +}; + +static const struct serial_rs485 fintek_8250_rs485_supported = { + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND, +}; + static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart) { struct fintek_8250 *pdata = uart->port.private_data; @@ -435,6 +446,10 @@ static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart) case CHIP_ID_F81866: case CHIP_ID_F81865: uart->port.rs485_config = fintek_8250_rs485_config; + if (!pdata->index) + uart->port.rs485_supported = &fintek_8250_rs485_supported_port0; + else + uart->port.rs485_supported = &fintek_8250_rs485_supported; break; default: /* No RS485 Auto direction functional */ -- 2.30.2