/*
 * include/linux/amlogic/usbtype.h
 *
 * Copyright (C) 2015 Amlogic, Inc. 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 as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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 __USB_CLK_HEADER_
#define __USB_CLK_HEADER_

#include <linux/platform_device.h>

#define USB_BC_MODE_DISCONNECT	0	/* Disconnected */
#define USB_BC_MODE_SDP		1	/* PC */
#define USB_BC_MODE_DCP		2	/* Charger */
#define USB_BC_MODE_CDP		3	/* PC + Charger */

#define USB_CORE_RESET_TIME	300
#define USB_ID_CHANGE_TIME	100

enum usb_port_type_e {
	USB_PORT_TYPE_OTG = 0,
	USB_PORT_TYPE_HOST,
	USB_PORT_TYPE_SLAVE,
};

enum usb_port_speed_e {
	USB_PORT_SPEED_DEFAULT = 0,
	USB_PORT_SPEED_HIGH,
	USB_PORT_SPEED_FULL
};

enum usb_dma_config_e {
	USB_DMA_BURST_DEFAULT = 0,
	USB_DMA_BURST_SINGLE,
	USB_DMA_BURST_INCR,
	USB_DMA_BURST_INCR4,
	USB_DMA_BURST_INCR8,
	USB_DMA_BURST_INCR16,
	USB_DMA_DISABLE,
};

enum usb_phy_id_mode_e {
	USB_PHY_ID_MODE_HW = 0,
	USB_PHY_ID_MODE_SW_HOST,
	USB_PHY_ID_MODE_SW_SLAVE
};

enum usb_port_idx_e {
	USB_PORT_IDX_A = 0,
	USB_PORT_IDX_B,
	USB_PORT_IDX_C,
	USB_PORT_IDX_D
};

enum lm_device_type_e {
	LM_DEVICE_TYPE_USB = 0,
	LM_DEVICE_TYPE_SATA = 1,
};

int clk_enable_usb(struct platform_device *pdev, const char *s_clock_name,
		unsigned long usb_peri_reg, const char *cpu_type);

int clk_disable_usb(struct platform_device *pdev, const char *s_clock_name,
		unsigned long usb_peri_reg, const char *cpu_type);

int clk_resume_usb(struct platform_device *pdev, const char *s_clock_name,
		unsigned long usb_peri_reg, const char *cpu_type);

int clk_suspend_usb(struct platform_device *pdev, const char *s_clock_name,
		unsigned long usb_peri_reg, const char *cpu_type);



extern int dwc_otg_power_register_notifier(struct notifier_block *nb);
extern int dwc_otg_power_unregister_notifier(struct notifier_block *nb);
extern int dwc_otg_charger_detect_register_notifier(struct notifier_block *nb);
#endif
