From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Mon, 8 May 2017 10:38:10 -0600 Subject: [U-Boot] [PATCH V3 1/4] usb: rockchip: add the rockusb gadget In-Reply-To: References: <1493426498-5839-1-git-send-email-eddie.cai.linux@gmail.com> <1493426498-5839-2-git-send-email-eddie.cai.linux@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Eddie, On 2 May 2017 at 02:47, Eddie Cai wrote: > > Hi Simon > > 2017-04-30 11:49 GMT+08:00 Simon Glass : > > Hi Eddie, > > > > On 28 April 2017 at 18:41, Eddie Cai wrote: > >> this patch implement rockusb protocol on the device side. this is based on USB > >> download gadget infrastructure. the rockusb function implements the rd, wl, rid > >> commands. it can work with rkdeveloptool. > >> > >> Signed-off-by: Eddie Cai > >> > >> Changes in v3: > >> -split the macro to f_rockusb.h > >> -use ALLOC_CACHE_ALIGN_BUFFER to define cache safe struct inside the function. > >> -fix checkpatch error > >> > >> --- > >> arch/arm/include/asm/arch-rockchip/f_rockusb.h | 104 ++++ > >> drivers/usb/gadget/Makefile | 1 + > >> drivers/usb/gadget/f_rockusb.c | 724 +++++++++++++++++++++++++ > >> 3 files changed, 829 insertions(+) > >> create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h > >> create mode 100644 drivers/usb/gadget/f_rockusb.c [..] > >> +char *rockusb_dev_type = 0; > >> +int rockusb_dev_index = 0; > > > > Move to top > OK > > > > I wonder if you should group all your data in a struct? > this data is useless if we just want to talk to cpu, get cpu info etc. > So no need to group > it in a struct. i will make it static to avoid other module use it The thing is that we should convert USB gadgets to driver model at some point. When we do, we cannot have static local data - it all needs to go into a driver-model struct. So I think it is better to do this now, and have a single static struct locally, then pass it around between the functions in this file. That way we have less work to do with DM conversion. Regards, Simon