blob: 9ecb598e48f0414ad1b559b76b7d3dd14c8d11d1 [file] [log] [blame]
Peter Chenc10b4f02013-08-14 12:44:06 +03001/*
Peter Chen5332ff12014-01-10 13:51:31 +08002 * Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
Peter Chenc10b4f02013-08-14 12:44:06 +03003 *
4 * Author: Peter Chen
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
12#define __DRIVERS_USB_CHIPIDEA_OTG_H
13
Li Jun0c33bf72014-04-23 15:56:38 +080014u32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask);
15void hw_write_otgsc(struct ci_hdrc *ci, u32 mask, u32 data);
Peter Chenc10b4f02013-08-14 12:44:06 +030016int ci_hdrc_otg_init(struct ci_hdrc *ci);
Peter Chencbec6bd2013-08-14 12:44:10 +030017void ci_hdrc_otg_destroy(struct ci_hdrc *ci);
18enum ci_role ci_otg_role(struct ci_hdrc *ci);
Peter Chena107f8c2013-08-14 12:44:11 +030019void ci_handle_vbus_change(struct ci_hdrc *ci);
Peter Chenbe6b0c12014-05-23 08:12:49 +080020static inline void ci_otg_queue_work(struct ci_hdrc *ci)
21{
22 disable_irq_nosync(ci->irq);
23 queue_work(ci->wq, &ci->work);
24}
Peter Chenc10b4f02013-08-14 12:44:06 +030025
26#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */