From 82a0ca0e2d89e797fbbf2001ec5403764132998c Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Thu, 17 Mar 2016 00:27:10 -0700 Subject: usb: pd: Add initial support for USB Power Delivery Add PD policy engine driver. This driver will interact with the charger/Type-C module via power_supply framework, and in turn notify the USB controller on when to begin/end data operation using extcon. For this initial patch this driver is simply acting as a pass-through between Type-C connection states and relaying them as USB/USB_HOST notifications. Change-Id: Ieba8e68761beef83a572b75b6b5f3b7ab7802e9e Signed-off-by: Jack Pham --- drivers/usb/pd/usbpd.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 drivers/usb/pd/usbpd.h (limited to 'drivers/usb/pd/usbpd.h') diff --git a/drivers/usb/pd/usbpd.h b/drivers/usb/pd/usbpd.h new file mode 100644 index 000000000000..7a24d33190e4 --- /dev/null +++ b/drivers/usb/pd/usbpd.h @@ -0,0 +1,43 @@ +/* Copyright (c) 2016, 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 _USBPD_H +#define _USBPD_H + +#include + +struct usbpd; + +#if IS_ENABLED(CONFIG_USB_PD_POLICY) +struct usbpd *usbpd_create(struct device *parent); +void usbpd_destroy(struct usbpd *pd); +#else +static inline struct usbpd *usbpd_create(struct device *parent) +{ + return ERR_PTR(-ENODEV); +} +static inline void usbpd_destroy(struct usbpd *pd) { } +#endif + +enum data_role { + DR_NONE = -1, + DR_UFP = 0, + DR_DFP = 1, +}; + +enum power_role { + PR_NONE = -1, + PR_SINK = 0, + PR_SRC = 1, +}; + +#endif /* _USBPD_H */ -- cgit v1.2.3