Return-Path: From: Amitkumar Karwar To: Jeffy Chen , "linux-bluetooth@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" , "Ganapathi Bhat" , Cathy Luo Subject: RE: [v11,3/3] Bluetooth: hci_uart: Support firmware download for Marvell Date: Mon, 27 Jun 2016 06:28:10 +0000 Message-ID: References: <1462548714-7971-3-git-send-email-akarwar@marvell.com> <576CCCDE.1050004@rock-chips.com> In-Reply-To: <576CCCDE.1050004@rock-chips.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: SGkgTWFyY2VsLA0KDQo+IEZyb206IEplZmZ5IENoZW4gW21haWx0bzpqZWZmeS5jaGVuQHJvY2st Y2hpcHMuY29tXQ0KPiBTZW50OiBGcmlkYXksIEp1bmUgMjQsIDIwMTYgMTE6MzIgQU0NCj4gVG86 IEFtaXRrdW1hciBLYXJ3YXI7IGxpbnV4LWJsdWV0b290aEB2Z2VyLmtlcm5lbC5vcmcNCj4gQ2M6 IGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc7IEdhbmFwYXRoaSBCaGF0DQo+IFN1YmplY3Q6 IFJlOiBbdjExLDMvM10gQmx1ZXRvb3RoOiBoY2lfdWFydDogU3VwcG9ydCBmaXJtd2FyZSBkb3du bG9hZA0KPiBmb3IgTWFydmVsbA0KPiANCj4gT24gMjAxNi01LTYgMjM6MzEsIEFtaXRrdW1hciBL YXJ3YXIgd3JvdGU6DQo+ID4gRnJvbTogR2FuYXBhdGhpIEJoYXQgPGdiaGF0QG1hcnZlbGwuY29t Pg0KPiA+DQo+ID4gVGhpcyBwYXRjaCBpbXBsZW1lbnQgZmlybXdhcmUgZG93bmxvYWQgZmVhdHVy ZSBmb3IgTWFydmVsbCBCbHVldG9vdGgNCj4gPiBkZXZpY2VzLiBJZiBmaXJtd2FyZSBpcyBhbHJl YWR5IGRvd25sb2FkZWQsIGl0IHdpbGwgc2tpcCBkb3dubG9hZGluZy4NCj4g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