Received: by 10.213.65.68 with SMTP id h4csp838674imn; Wed, 14 Mar 2018 01:20:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELt6lrHscadD4nj9AsaPTyVbXzldnU/tSZReHvgXDuSk0Ko/8cXmrckkoo66qYbCMq4SZIyM X-Received: by 10.99.44.22 with SMTP id s22mr2966430pgs.111.1521015619502; Wed, 14 Mar 2018 01:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521015619; cv=none; d=google.com; s=arc-20160816; b=jNvhmFiIB4QyjK47V7dLJB+ogR7dxCdRxxGmfsgexvELgaF/o2eEZ6RksbDxeJlJEM xyXmCzSqhvIzj4ZLA9Psg41L+qFjtnFgGSN62s0DmTRZfieV8pv0X+c12XLd7WzI3qHD Yd3lrIq3oMUTkA0gL90QQ4MCcWQPhr5HLyE6mtdYWh2OSSc+zPtrhUYqL27doqZc1iLh xCUZv6k9WRutLxAq4v0r3kIHFq4XWvS4yAWvSeR9MHvWXK7M0ugJtluVjAOxqo/Rpr5R Hwcjb4G3MtN7rzFg0/jEuR39cY1nEcJcR1qoHewcRh0iUuWAwbm3kELw8+0jokLRHHEL BISQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=nmYXI0SxvNWPydiP22L4J4Bibf/4YNAHpqQBhHSP2Ko=; b=ySEDWzgdqo/4tvz38F7ojsSLJYJyvBYPAS/RUIMD5HKmvt1J2EhEIijQNTNIxTi4g2 Gvg4vc0P2KgbasxWIsDjc/KaNfI611tR+AIkQlQcbdvcwcGaqdLVpuQXtAmzbIv37hwF 5HsWKVaGKWPDN7rXpb3nOnhIjZZTcaqU//z+sweZvg1ws6ycsPNdRy7vGlGeTNP4XqCV ylpJZ70bqTiHbn6VQZMdlbZXPPQjgKMMOJUN1xEDMu5np58kTDN+LarT3s3WHRTP0Li+ S8b6mvJlNBYd+Ebg05dlpUTCODkCoa3/3YszXbqnDexaWTXePMAwc6wnr85RyOg0F6Ww +ZmA== ARC-Authentication-Results: i=1; mx.google.com; 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 n9-v6si1584875plk.71.2018.03.14.01.20.05; Wed, 14 Mar 2018 01:20:19 -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; 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 S1753651AbeCNITN (ORCPT + 99 others); Wed, 14 Mar 2018 04:19:13 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:13318 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753603AbeCNITJ (ORCPT ); Wed, 14 Mar 2018 04:19:09 -0400 X-UUID: 05667290370d4e1f89f63586432b55c1-20180314 Received: from mtkcas35.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 208566402; Wed, 14 Mar 2018 16:18:57 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 14 Mar 2018 16:18:56 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Wed, 14 Mar 2018 16:18:55 +0800 Message-ID: <1521015535.3717.26.camel@mhfsdcap03> Subject: Re: [PATCH] Add Apple Carplay driver From: Chunfeng Yun To: Matthew Dharm CC: Greg Kroah-Hartman , Matthias Brugger , Heikki Krogerus , Serge Semin , Guenter Roeck , Kate Stewart , Thomas Gleixner , "Alan Stern" , , , , Date: Wed, 14 Mar 2018 16:18:55 +0800 In-Reply-To: References: <1521007356-12306-1-git-send-email-chunfeng.yun@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-03-13 at 23:53 -0700, Matthew Dharm wrote: > Why is this a kernel-level driver, rather than a userspace application > that uses libusb to send the single vendor-specific command required? > Since this command would be applicable to many CarPlay devices, with > many different VID/PIDs, it would seem to make more sense as a > userspace app that took a reference to a USB device or VID/PID. Sorry, I'm not familiar with libusb. But after I roughly read a simple example using libusb, it indeed can be realized by a userspace driver. Thanks for your useful comments > > Matt > > On Tue, Mar 13, 2018 at 11:02 PM, Chunfeng Yun > wrote: > > From bf48dcd9cb254576cfea373c9a5d2ab996408895 Mon Sep 17 00:00:00 2001 > > From: Chunfeng Yun > > Date: Tue, 13 Mar 2018 11:47:38 +0800 > > Subject: [PATCH] Add Apple Carplay driver > > > > Some Apple devices which support Carplay can enter USB Host Mode from USB > > Device Mode after receiving a specific USB Vendor Request. There is a > > requirement apply to accesssories that support the USB dual role switch > > feature, and must have a USB-A receptacle that is capable of functioning > > in both USB Host and USB Device roles. > > It means that the driver should supports manual Dual-Role switch, due to > > no IDDIG pin is avaliable. > > > > There is no suitable place to add this spicific USB Vendor Request, so > > here I extract a single driver which allow user force to send it by a debug > > interface when need it, and keep it independent on USB Dual-Role Controller > > Drivers. > > But to implement carplay feature, there are some requirments for USB Dual-Role > > Driver: > > 1. supports manual dual-role switch, such as, by a debug interface; > > 2. keep vbus alive even when switch host into device mode; > > > > More information please refer to "Chapter 46. USB Role Switch" in > > MFI Accessroy Interface Specification.pdf > > > > Chunfeng Yun (1): > > usb: misc: supports Apple Carplay driver > > > > drivers/usb/misc/Kconfig | 9 +++ > > drivers/usb/misc/Makefile | 1 + > > drivers/usb/misc/carplay.c | 193 ++++++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 203 insertions(+) > > create mode 100644 drivers/usb/misc/carplay.c > > > > -- > > 1.7.9.5 > > > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > >