Received: by 10.213.65.68 with SMTP id h4csp802591imn; Tue, 13 Mar 2018 23:54:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELuMPWZTN6M1TuTRUHbnJkWtGdUAyiFEBlxWSiwOQ4fTQYjVpo0JBGw0F223MdmiP7bkcRdN X-Received: by 2002:a17:902:bcc5:: with SMTP id o5-v6mr3116320pls.86.1521010495486; Tue, 13 Mar 2018 23:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521010495; cv=none; d=google.com; s=arc-20160816; b=MCnw/TXDFbP+d5d9RqQhCsvLRRPOMlLkx4XKOXH6gHiZ23C7hIdCLANNkwsiFqwqXe K6uv2puxxoTZl6j4BSngDFPeIGd9v0vME2YPURYIvMDGUygGMrWXXozfK9URWhieC5hO 0okCRKAYtS4ebbfnzovrMvAnXufrVE92pm0rM5u0hm29OeZOBP5UgHewxwC/sPKba+DY 84UZKu7tLX14yh7lXDAdE8pfbdRiQ68j5XI5tjDhY10Ko0qs1I6K1cl2rrfxZwV8H1Zt /Fr9OnpzbeDA5os3aG5DBT/18SKlPTtZNVwui0/VZ4ofNEBfpZplRfj4skeyXYwax1RP VXtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=QZyfWRWnC2zhBJJ6gI8ZcJlFDr0HjxC17lUyk3yqegI=; b=TmIjw6qY6mE3Lu96b06aZaBNgWF6uvIKgvaq5H0bn89R6YWhVjr8rZdJVcL4BZJXo1 GQ7JFR3+yAwzMu7IoOADLe65Iptnv8n+xb+uvEAAIiD8UX41o5OnFsqat7iKdzbf0T7r j6h+rHB6+e6buXYIM+vfcL32tKO3yc3h9p6Qr1NEqwCktE3RxVYBp0CDc1Fx7snf2qUR esiaHibNHw3PjBoIpEL7cxO83ohXZdZCuTMspZYn0b+R6O/fsDtZAMMa7gBAyP5EnQ4j 2QNPjh9P7OHswMH7X9uop0kfraBDPhuUHpmeE2UkFSLjoj/nJqiuOUVmCxtlYl8SK6hF rQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@one-eyed-alien.net header.s=google header.b=fLLUpNMk; 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 b1-v6si1469312plc.679.2018.03.13.23.54.41; Tue, 13 Mar 2018 23:54:55 -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=@one-eyed-alien.net header.s=google header.b=fLLUpNMk; 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 S1753491AbeCNGxj (ORCPT + 99 others); Wed, 14 Mar 2018 02:53:39 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35971 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbeCNGxg (ORCPT ); Wed, 14 Mar 2018 02:53:36 -0400 Received: by mail-wm0-f66.google.com with SMTP id i194so1835602wmg.1 for ; Tue, 13 Mar 2018 23:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=one-eyed-alien.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QZyfWRWnC2zhBJJ6gI8ZcJlFDr0HjxC17lUyk3yqegI=; b=fLLUpNMk1oT6qNmAQS07S/D47AnxDF2dJ2Wx7mEu777p6xjPtEokwQXjzcTSg+d2eN 9AGBNL8MyxEkX9sJTNXMziQ4LMtnYzBLTqtmNA4+0+OA+L4XJHzw7Gm496rcP1BW30lL MYj81GnNYYZJQqAZ2/mRv5sh5Hb2N3grPZtFU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QZyfWRWnC2zhBJJ6gI8ZcJlFDr0HjxC17lUyk3yqegI=; b=NUv9qLnJxoKyQWqfd2xlVMuzUPkTVNAunvS+OSKUO5EnMsdxRA+lbqm0JBVgXdSiJ/ ueU1hatfU8XFWMy3xII0mLaouNTLWuvs71N/S0NUuFHR5ULpnM/FpY0nFNsjP+0lLpxA bd7Wx9cQ/uzzg2tgyTipEev6dT2QMtorW8jayCcKR804epriskyvzGAJqDGzN0SEy5YJ G4+QBbAjvgv0EZeZ84gzxDbOyvSNC0TdkEBUX9m/zUltiRSxQoz++07qyUgRAbp1ZeoN ejyE3TnGz6l5z3Uo1H9z7JCImNu08TBadgFmXrB2R55YS68DnJbw67Vje+Xv6OtBodtG 5bZg== X-Gm-Message-State: AElRT7GeDmaah0/lEMh4eTfGEL0BoNW47waGpLFkxFpu5yQnVsO9Hi7x lMEMF6YhkcKeQQOtpqn8VqCl6KrOlDU0pcUp4St8oA== X-Received: by 10.80.214.206 with SMTP id l14mr3695182edj.44.1521010415580; Tue, 13 Mar 2018 23:53:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.189.204 with HTTP; Tue, 13 Mar 2018 23:53:15 -0700 (PDT) In-Reply-To: <1521007356-12306-1-git-send-email-chunfeng.yun@mediatek.com> References: <1521007356-12306-1-git-send-email-chunfeng.yun@mediatek.com> From: Matthew Dharm Date: Tue, 13 Mar 2018 23:53:15 -0700 Message-ID: Subject: Re: [PATCH] Add Apple Carplay driver To: Chunfeng Yun Cc: Greg Kroah-Hartman , Matthias Brugger , Heikki Krogerus , Serge Semin , Guenter Roeck , Kate Stewart , Thomas Gleixner , Alan Stern , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 -- Matthew Dharm Former Maintainer, USB Mass Storage driver for Linux