Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3004271ybg; Thu, 24 Oct 2019 19:49:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTsTBBatJ3z1ecFZ23Cr3ngUYqDs0p/K7zeWLdgn8If+AjCI6rDDvfNIEp7EF+Qtw0u3w4 X-Received: by 2002:a17:906:557:: with SMTP id k23mr1187412eja.165.1571971780683; Thu, 24 Oct 2019 19:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571971780; cv=none; d=google.com; s=arc-20160816; b=XxwhUQ2o/TUqyfPQJ9+OAYczQL6+CTBP8Uo/2B1TYxlirFIb5NeTbE/6iCaGqK3p25 BB52cd/wYnniaGQewpKEuzSwoiXIamPBZ0rhguCkfaP7XJCpSH8jpUPn86s87F/hbOZR d/P2X8tJqi4kr8zTCmycVX4F/L0E8/XjO8gHoZiK2Alr5dCuyfVFPdScQRqDKIW+bRfz VeiOfofzpVtMnWwxUP1eGyHYvlSKcr+FFZT3BTV0txm6Fqlg7tJCpt1SmY3HPNEyf6k9 LSMqBQITg+d0eCMz7KaUEG9xaMHsCUvme0lDtbxRKkzCE4jB6zjIIfj8/i+UeP2OsyHW ekPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uPX6O9l+kuYjBcPYdh37KOiS7f3AWvLRqvSNRDK/hlY=; b=C4YgTI/zPlYXsiTAoU6oPCdsYwU3WygK1Q0X4fJdIKPA8Go6kg2mhYSZyAEH7t+G1w zy9g4FOivnvWCMVgrG3TJr+osqLtKWMbpccYGF8aF0mNyYGeZsk17wQVLTn9NiQND7ue GWaB+o2MN79Dt7h+TqXj4N0ye7dqBudmLgy/0YSY7VYffsnQsGEoQw7/m//+9X3jt2Nb RzAhuxXc3IxvH6Lg98JI/9hTvpNvSTHQQghet79xotINkEaPUusfkCfbvLpM/O4NDKXv W6m65OzmgJeZxHixsBJKPq4TkImvFuct1sG2fGVK/9R8r1dQ8gE/+R4jEs47RgUNsNoc y2aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rrxFfBuN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si401608eja.294.2019.10.24.19.49.11; Thu, 24 Oct 2019 19:49:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rrxFfBuN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438482AbfJXIwF (ORCPT + 99 others); Thu, 24 Oct 2019 04:52:05 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46134 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730467AbfJXIwE (ORCPT ); Thu, 24 Oct 2019 04:52:04 -0400 Received: by mail-pl1-f194.google.com with SMTP id q21so3444120plr.13; Thu, 24 Oct 2019 01:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=uPX6O9l+kuYjBcPYdh37KOiS7f3AWvLRqvSNRDK/hlY=; b=rrxFfBuNj1V+uFY7mLjfFUPtV4lB6aOMWJC30bQxiPaE9cV/lD9sVOk3SIk3xxu0UX 7F6JWvBWNVcMfeQWKPE8B5LBRJjebHT/fuosPKegNwFQzyIYFqbONhmfvmuGJ4lcZfxN MDyqg014EdBJuLkMqaIOgHYKfC8AYe+RSXf2U0eV33pxwwElrd7XoEzdWfO0gI2utY+f 2uNL8ed8lY1uV4upV/zKMvG/NspEHAmx+GchOcN00B0baykx4rU66sP4SS9BkTDBMdRV 25+LfK7LnYZKNtfAg4wEHKm85FsLkusC2tgS3ToH08UFikNjzerI4RCY9jdRwyBgtwdb pgsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uPX6O9l+kuYjBcPYdh37KOiS7f3AWvLRqvSNRDK/hlY=; b=Pp7aTGlLmlj69k73EB4mIzKLJsspL7zQ11zRs/Tj+Slgr3TtCi4ZuOP7S1n2aYLcB1 AomH5N7XunEwzrWWxuz7LM26PUMb9hTdHNEyGUtcceHS43f6tj1otwrnBhmyhbIFxQpL WzFWKY30QiCG7JMzKI4ZITb0s4BXSbQoBzp3/CfT9ZhhMMAd7jnXYbS+7PKZQAAXEDaf kX5h9bL1wf7/5MVXDjARPKAlCa+1Wwxozf7fczPUXIwCqW60QLh9pg4z9i+TVrvDK5d5 Clzds1qJEeP5ZkiZeQbtGfzn/udA2+o1Z5IodxKh6pFFmMSo49EoXHPY8CgySm6Cz1me odUg== X-Gm-Message-State: APjAAAWG/pPwv+v+EHnlliDcfkibmj/d5HRh6NiAQ7WJ6de33PHBLZqI nLd+/DG1pAIi1wNYfEkuo+o= X-Received: by 2002:a17:902:b60a:: with SMTP id b10mr15125831pls.130.1571907123451; Thu, 24 Oct 2019 01:52:03 -0700 (PDT) Received: from [192.168.1.60] (59-120-186-245.HINET-IP.hinet.net. [59.120.186.245]) by smtp.gmail.com with ESMTPSA id s191sm23097338pgc.94.2019.10.24.01.52.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2019 01:52:02 -0700 (PDT) Subject: Re: [PATCH V2 5/7] USB: serial: f81232: Set F81534A serial port with RS232 mode To: Johan Hovold Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter_hong@fintek.com.tw, "Ji-Ze Hong (Peter Hong)" References: <20190923022449.10952-1-hpeter+linux_kernel@gmail.com> <20190923022449.10952-6-hpeter+linux_kernel@gmail.com> <20191023115300.GU24768@localhost> From: "Ji-Ze Hong (Peter Hong)" Message-ID: Date: Thu, 24 Oct 2019 16:52:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191023115300.GU24768@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Johan, Johan Hovold 於 2019/10/23 下午 07:53 寫道: > On Mon, Sep 23, 2019 at 10:24:47AM +0800, Ji-Ze Hong (Peter Hong) wrote: >> The Fintek F81532A/534A/535/536 is USB-to-2/4/8/12 serial ports device >> and the serial ports are default disabled. Each port contains max 3 pins >> GPIO and the 3 pins are default pull high with input mode. >> >> When the serial port had activated (running probe()), we'll transform the >> 3 pins from GPIO function publicly to control Tranceiver privately use. > > I'm not sure I understand what you're saying here. > >> We'll default set to 0/0/1 for control transceiver to RS232 mode. >> >> Otherwise, If the serial port is not active, the 3 pins is in GPIO mode >> and controlled by global GPIO device with VID/PID: 2c42/16f8. > > Does this mean that you can control the three GPIOs either through the > serial device or through the gpio-control device (which are two separate > USB devices)? > Yes, when 1 F81534A connect to Host, it'll report device as following. virtual HUB GPIO Device. serial port 1 ... serial port n The link are F81534A pin-out: https://imgur.com/a/AZHqQ1N So we can control F81534A series all GPIO pins via GPIO Device. Serial ports are also control MODE0_x, MODE1_x, MODE2_x (e.g. UART1 MODE0_1, MODE1_1, MODE2_1), but when Serial ports is h/w disabled (DTR pull low), the mode pin will change to GPIO pin. > Ok, so you reset the tranceiver config on every probe. > > Are the three GPIOs always connected to one particular tranceiver, or > are they truly general purpose? > > In the latter case, it doesn't seem like a good idea to drive pins 0 > and 1 low here as you have know idea what they're used for. If we want to change the mode pin to GPIO pin, it need do h/w disable. It the serial ports are activated, the 3 pin will be mode pin and set default 0/0/1 to RS232 mode due to this driver not implement RS422/485 currently. Thanks -- With Best Regards, Peter Hong