Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp281204iof; Mon, 6 Jun 2022 03:26:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbcK4D92OqawVXC4YWUeZ0jNhP0Kqdz7eiJ4gUsTMbhYeOCPr1olnuf3SUjAghNKelNk0p X-Received: by 2002:a63:b5f:0:b0:3fd:af27:5469 with SMTP id a31-20020a630b5f000000b003fdaf275469mr5085004pgl.565.1654511199573; Mon, 06 Jun 2022 03:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654511199; cv=none; d=google.com; s=arc-20160816; b=l/JZHHMHvkeXQmA1mC77F3GwW+BmUCuPRHcIxlRpu3f3EAgEQQHX4oz3rDP+NTxSiE aD8TQ1+N19fyrO8MpfNtHuvcfBONoiDH6g3o3VHp6t39MLtP3uruL1ZipxGdb6t5oJFt bvQwKnFnhjUTuQyaOis2DR2ZlrJuzI8l7UoHEqu2Mnv04pz2wA7j09lHkr/uezdN69Hp 3mbiKHEIEvq1KaVtGi5RPxRls7w22YoafT1dceHKseFzd19RrVkzLtXVDeU+8rj5efze wW1yK10TxPRBNswmLFEHe8lPkmdDaGmotVOqIxiedXZyWgoFNdqwJ7CmPdklcG+eA8JQ JUpg== 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=j92DJ5jn6B9PoXNQl+qlVyC2owRnKLSxX9YqB05r8vU=; b=jc/CXoiS2pR/zUxuRtu477b0ZjRuQ6qLJExhrFlkNu+a8GNHbQsZ9+tfUxyaTLBk0M 2c1Ed/kdrtmsqyvK0FoKbVLozWXxGa42fsD7K30/fQXCIBbn4lsTxI95qP7xCb/zMTZM uPwjn048SrsLmGO6M/78hGp89PoHQUCyWULwDl6ZrMBR/e1RcTOkpvq62RkG30kwoXcq nhOW04QLvRRBYaKhtKO+CxdsiiRjLUSuiMsd7D37/TgmNUaTD3EwDA2KKBe90VHUxJUK 1XMe6v8ajJ8b/Gbo01KUkRtmMlfSsoVlN9SSmCDPlyt0IDdr/eWrl3FTo+0HDU1abd+h dQgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="P/6fB59t"; 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 j3-20020a170903028300b001619aaf38b2si26230668plr.65.2022.06.06.03.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 03:26:39 -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="P/6fB59t"; 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 1493014086A; Mon, 6 Jun 2022 03:06:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233459AbiFFKGL (ORCPT + 99 others); Mon, 6 Jun 2022 06:06:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233289AbiFFKFd (ORCPT ); Mon, 6 Jun 2022 06:05:33 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAE166FA19; Mon, 6 Jun 2022 03:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654509929; x=1686045929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=30sgEmomZFJSjr9ND+w2PFIvZclLSnuuV9GPE1kuVgI=; b=P/6fB59tKAS+++Ev8mLX5KcQJjwgT0nIKcD74+Fv/vC7G8/Pj0ibNTcO 9mY4p1twYlb+wyh+OcBr1KjDM+JSzPCr9obHxGZ6B6JtRj85UwVfzDChK +MRbIgj3+1LNFyjEDVYnjGrjX/dUNeNhTjpyupL1fTL6tc7pKNdLYG0VM b7SMI4rJg8Pni5sPq7LLhls+9AAE0Y5uamJa8irKRWIvmqCSBKFDUUUIt lPjJHiu7xdq7a7047fUnjbjorqej5nKIKavHlq4842+9HVSXeh9a4T+36 N4OBq2xm14GKaXP1GJKmQ45IjGrm5RCa6fe7XDRtSlR3y42lEppLv2XM7 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="362987036" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="362987036" 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:03 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635523476" 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:01 -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 04/36] serial: 8250: Create serial8250_em485_supported for em485 users Date: Mon, 6 Jun 2022 13:04:01 +0300 Message-Id: <20220606100433.13793-5-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 Create serial8250_em485_supported for the serial_rs485 features supported by the em485 framework. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/8250/8250.h | 1 + drivers/tty/serial/8250/8250_port.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index d70adaa3b117..e5d44867a876 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -187,6 +187,7 @@ int serial8250_em485_config(struct uart_port *port, struct serial_rs485 *rs485); void serial8250_em485_start_tx(struct uart_8250_port *p); void serial8250_em485_stop_tx(struct uart_8250_port *p); void serial8250_em485_destroy(struct uart_8250_port *p); +extern struct serial_rs485 serial8250_em485_supported; /* MCR <-> TIOCM conversion */ static inline int serial8250_TIOCM_to_MCR(int tiocm) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index d7384ab364d2..a825fbc215a7 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -647,6 +647,14 @@ void serial8250_em485_destroy(struct uart_8250_port *p) } EXPORT_SYMBOL_GPL(serial8250_em485_destroy); +struct serial_rs485 serial8250_em485_supported = { + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND | + SER_RS485_TERMINATE_BUS | SER_RS485_RX_DURING_TX, + .delay_rts_before_send = 1, + .delay_rts_after_send = 1, +}; +EXPORT_SYMBOL_GPL(serial8250_em485_supported); + /** * serial8250_em485_config() - generic ->rs485_config() callback * @port: uart port -- 2.30.2