Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5999249ybc; Wed, 27 Nov 2019 13:09:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwJoWl4JsDXyIdxr3dDsRGyJr3isws+DVtBSIBtX7cZC26UWoJ6lIu0GW08SS3B3xnuZRE+ X-Received: by 2002:a17:906:1611:: with SMTP id m17mr52406644ejd.281.1574888984315; Wed, 27 Nov 2019 13:09:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888984; cv=none; d=google.com; s=arc-20160816; b=i+q2KJVhdUZGfNA+vieeZosK88BchosPu3/l+70+arZFm0rXCc4TB1Bllyj3nCav7p iTLIWwPGJrPnG1iYR9daGSqs6yaAbgk7u/X86S30Vj/4n7fPzFG5XkdmmSumzwSKh5qK Xh1QpFD1oN3kr7Y9ynGE4JHnsmDoO3uM3pS/nVGaVJd+307PDHXK1ni4GNKrXzpTTOoB jBiEUI0WC3wHJCPNT02Ge8yHAXFKR0vquCWzGHZJiZ2sJ7kSGTB5auXXmXMMoGnSY5QN Mvh0ZgL4V3v/sz4xAUYdXp9AMGHQ29tsETV5KoOXVGBxlfw2cIG5AujFVTKggcO1vT8H X8PA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9KHB0c3XSAPQnqUrhw47zbY/kUtOUTtfDIwCikKzOIo=; b=luG+XCEXCdkJ6M9QZuiHIJKS4hIQAxaj3QqyzcyHds7w0u8GFkM4LFO32RsGRyWzQq rzGZuQWDt0mWJ+Kjvm5exFs4KlgCBlO7RcDhk0z5oyXYdfxFUoLMyvX4qELb4oQsagyu O3rABG1NbMQTWbMVl0Zek25hFxcG4YVFmp0pxmQQsXdav+74FiK6b4MDTc7oNSv0kU9y 7In7AzBBqpU5V0JWiM36X9VsYKsKlvM4eZjG0SgGX9eC3I9kw415KHceh9ZC5lbm+V1v 81HELCKu8BzTmR0VlGn+pG1O5DPcgvxDf21AVIihVFuJcAifodNHd8qZ0tWijXxaAj1c iPRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OXr+gQXu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si11758604edm.344.2019.11.27.13.09.20; Wed, 27 Nov 2019 13:09:44 -0800 (PST) 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=@kernel.org header.s=default header.b=OXr+gQXu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732154AbfK0VHo (ORCPT + 99 others); Wed, 27 Nov 2019 16:07:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:33930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732638AbfK0VHl (ORCPT ); Wed, 27 Nov 2019 16:07:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 45E532176D; Wed, 27 Nov 2019 21:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888860; bh=OgxL2iwhe6dwLzG1pjdCdEAEYq0yaI02Z8MvenuIPBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OXr+gQXunEVWK25oJeim/H2DvfGHqMejXbt6paFnzB/c2unj9cDhPIRvJobFIA4tB L4jKg9sYKlQz9eLeYzDdGmQZNYqUbovIyYpbq2Ao/9FyJUY9oxSDglN9LimRY9VETj 4WEbKh4UWGXu3esAYDQbKK/OviMJgQm/3IJXJ+7I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pavel=20L=C3=B6bl?= , Johan Hovold Subject: [PATCH 4.19 298/306] USB: serial: mos7840: add USB ID to support Moxa UPort 2210 Date: Wed, 27 Nov 2019 21:32:28 +0100 Message-Id: <20191127203136.504581655@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Löbl commit e696d00e65e81d46e911f24b12e441037bf11b38 upstream. Add USB ID for MOXA UPort 2210. This device contains mos7820 but it passes GPIO0 check implemented by driver and it's detected as mos7840. Hence product id check is added to force mos7820 mode. Signed-off-by: Pavel Löbl Cc: stable [ johan: rename id defines and add vendor-id check ] Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/mos7840.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -118,11 +118,15 @@ /* This driver also supports * ATEN UC2324 device using Moschip MCS7840 * ATEN UC2322 device using Moschip MCS7820 + * MOXA UPort 2210 device using Moschip MCS7820 */ #define USB_VENDOR_ID_ATENINTL 0x0557 #define ATENINTL_DEVICE_ID_UC2324 0x2011 #define ATENINTL_DEVICE_ID_UC2322 0x7820 +#define USB_VENDOR_ID_MOXA 0x110a +#define MOXA_DEVICE_ID_2210 0x2210 + /* Interrupt Routine Defines */ #define SERIAL_IIR_RLS 0x06 @@ -193,6 +197,7 @@ static const struct usb_device_id id_tab {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, + {USB_DEVICE(USB_VENDOR_ID_MOXA, MOXA_DEVICE_ID_2210)}, {} /* terminating entry */ }; MODULE_DEVICE_TABLE(usb, id_table); @@ -2053,6 +2058,7 @@ static int mos7840_probe(struct usb_seri const struct usb_device_id *id) { u16 product = le16_to_cpu(serial->dev->descriptor.idProduct); + u16 vid = le16_to_cpu(serial->dev->descriptor.idVendor); u8 *buf; int device_type; @@ -2062,6 +2068,11 @@ static int mos7840_probe(struct usb_seri goto out; } + if (vid == USB_VENDOR_ID_MOXA && product == MOXA_DEVICE_ID_2210) { + device_type = MOSCHIP_DEVICE_ID_7820; + goto out; + } + buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); if (!buf) return -ENOMEM;