android_kernel_oneplus_msm8998/include/linux/qcom/diag_dload.h
Jack Pham 4d50aa3264 usb: gadget: Move diag dload handling to f_diag driver
Upon Diag function bind, the DLOAD memory region should be
updated with the USB PID and serial number in order to support
a persistent connection with the PC if the device reboots into
download mode.

This functionality need not be handled in the android.c driver.
The only reason it is there is to be able to locate the IO address
which is specified in device tree. Since this can be done from
the Diag function driver directly, move the handling there.

The address itself can be specified under the "qcom,msm-imem"
parent with its own "qcom,msm-imem-diag-dload" compatible string.
For now, allow falling back to retrieving the address from the
"android_usb" for backwards compatibility until the device tree
files are updated.

Change-Id: I0d6d1dac0f12b7890220d857227ae45c9258c1f2
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-03-22 11:03:01 -07:00

32 lines
897 B
C

/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __LINUX_DIAG_DLOAD_H__
#define __LINUX_DIAG_DLOAD_H__
#define PID_MAGIC_ID 0x71432909
#define SERIAL_NUM_MAGIC_ID 0x61945374
#define SERIAL_NUMBER_LENGTH 128
struct magic_num_struct {
uint32_t pid;
uint32_t serial_num;
};
struct dload_struct {
uint32_t pid;
char serial_number[SERIAL_NUMBER_LENGTH];
struct magic_num_struct magic_struct;
};
#endif