From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754551AbdKARFP (ORCPT ); Wed, 1 Nov 2017 13:05:15 -0400 Received: from mail1.bemta6.messagelabs.com ([193.109.254.109]:11728 "EHLO mail1.bemta6.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754878AbdKARDO (ORCPT ); Wed, 1 Nov 2017 13:03:14 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjleJIrShJLcpLzFFi42KJ27nUWDfg389 Ig8PtkhbNi9ezWbw5Pp3Jomv1ThaLy7vmsFl87j3CaLFoWSuzxZOFZ5gsGhe8Z7E4vbvE4s/z W2wOXB47Z91l99i0qpPNY97JQI/9c9ewe7zfd5XNY+f3BnaPz5vkAtijWDPzkvIrElgztt36x lgwl6+i7dZt9gbGqTxdjJwcQgLrGCWm3DbpYuQAsiskNux3AzF5BTIlnh71AqngFHCXeHL4Ly NEtZvE3iO9YDabgIXE5BMP2EBsFgEVibvX+5hBWoUFAiQePlHvYuTiEBGYxyTxasNdsBpmgTq J3t9vWUBsXgFBiZMzn7BAxCUkDr54wQwx30Di9IJGsLiEgL3E9PdXwWZKCOhLNB6LhQgbSnyf 9Q2qxFyifeM+5gmMgrOQTJ2FZOoCRqZVjBrFqUVlqUW6hkZ6SUWZ6RkluYmZObqGBmZ6uanFx YnpqTmJScV6yfm5mxiBccIABDsYL28MOMQoycGkJMqref9npBBfUn5KZUZicUZ8UWlOavEhRh kODiUJXoG/QDnBotT01Iq0zBxgxMKkJTh4lER414CkeYsLEnOLM9MhUqcYdTmezXzdwCzEkpe flyolzqsLUiQAUpRRmgc3ApY8LjHKSgnzMgIdJcRTkFqUm1mCKv+KUZyDUUmYlwdkCk9mXgnc pldARzABHeEl8QPkiJJEhJRUA+PMvmDfZpt/73TXG8fs5eR0PHxraUnGvOs3q7anCZbxnOt6N YG19P7WGf2uVwo+/T/0dre+/FL3V/6vb9hvkb3w2buodFGvU+X3iSZtSlf8guycLweoa35u3p zhcHPzezfmwqJynYiUim1THuQ4uFTwHr3ts1dRfcPTjtRNzJfMYzdc+7w3fqISS3FGoqEWc1F xIgA/32sCGQMAAA== X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-13.tower-193.messagelabs.com!1509555792!108141758!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Message-ID: <4199ae7655886b8ba7a436d3a9938220d2e14f0b.1509554370.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Wed, 1 Nov 2017 17:03:11 +0000 Subject: [RFC PATCH 3/7] typec: tcpm: Add SDB header for Status message handling To: Heikki Krogerus , Guenter Roeck , Greg Kroah-Hartman , Sebastian Reichel , Hans de Goede , Yueyao Zhu , Rui Miguel Silva CC: , , , MIME-Version: 1.0 Content-Type: text/plain X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 01/11/2017 12:45:00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit adds a header providing definitions for handling Status messages. Currently the header only focuses on handling incoming Status messages. Signed-off-by: Adam Thomson --- include/linux/usb/pd_ext_sdb.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 include/linux/usb/pd_ext_sdb.h diff --git a/include/linux/usb/pd_ext_sdb.h b/include/linux/usb/pd_ext_sdb.h new file mode 100644 index 0000000..6d6da31 --- /dev/null +++ b/include/linux/usb/pd_ext_sdb.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2017 Dialog Semiconductor + * + * Author: Adam Thomson + * + * 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 __LINUX_USB_PD_EXT_SDB_H +#define __LINUX_USB_PD_EXT_SDB_H + +/* SDB : Status Data Block */ +enum pd_ext_sdb_fields { + EXT_SDB_INTERNAL_TEMP = 0, + EXT_SDB_PRESENT_INPUT, + EXT_SDB_PRESENT_BATT_INPUT, + EXT_SDB_EVENT_FLAGS, + EXT_SDB_TEMP_STATUS, + EXT_SDB_DATA_SIZE, +}; + +/* Event Flags */ +#define EXT_SDB_EVENT_OCP BIT(1) +#define EXT_SDB_EVENT_OTP BIT(2) +#define EXT_SDB_EVENT_OVP BIT(3) +#define EXT_SDB_EVENT_CF_CV_MODE BIT(4) + +#define EXT_SDB_PPS_EVENTS (EXT_SDB_EVENT_OCP | \ + EXT_SDB_EVENT_OTP | \ + EXT_SDB_EVENT_OVP) + +#endif /* __LINUX_USB_PD_EXT_SDB_H */ -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Thomson Subject: [RFC PATCH 3/7] typec: tcpm: Add SDB header for Status message handling Date: Wed, 1 Nov 2017 17:03:11 +0000 Message-ID: <4199ae7655886b8ba7a436d3a9938220d2e14f0b.1509554370.git.Adam.Thomson.Opensource@diasemi.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Heikki Krogerus , Guenter Roeck , Greg Kroah-Hartman , Sebastian Reichel , Hans de Goede , Yueyao Zhu , Rui Miguel Silva Cc: linux-usb@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, support.opensource@diasemi.com List-Id: linux-pm@vger.kernel.org This commit adds a header providing definitions for handling Status messages. Currently the header only focuses on handling incoming Status messages. Signed-off-by: Adam Thomson --- include/linux/usb/pd_ext_sdb.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 include/linux/usb/pd_ext_sdb.h diff --git a/include/linux/usb/pd_ext_sdb.h b/include/linux/usb/pd_ext_sdb.h new file mode 100644 index 0000000..6d6da31 --- /dev/null +++ b/include/linux/usb/pd_ext_sdb.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2017 Dialog Semiconductor + * + * Author: Adam Thomson + * + * 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 __LINUX_USB_PD_EXT_SDB_H +#define __LINUX_USB_PD_EXT_SDB_H + +/* SDB : Status Data Block */ +enum pd_ext_sdb_fields { + EXT_SDB_INTERNAL_TEMP = 0, + EXT_SDB_PRESENT_INPUT, + EXT_SDB_PRESENT_BATT_INPUT, + EXT_SDB_EVENT_FLAGS, + EXT_SDB_TEMP_STATUS, + EXT_SDB_DATA_SIZE, +}; + +/* Event Flags */ +#define EXT_SDB_EVENT_OCP BIT(1) +#define EXT_SDB_EVENT_OTP BIT(2) +#define EXT_SDB_EVENT_OVP BIT(3) +#define EXT_SDB_EVENT_CF_CV_MODE BIT(4) + +#define EXT_SDB_PPS_EVENTS (EXT_SDB_EVENT_OCP | \ + EXT_SDB_EVENT_OTP | \ + EXT_SDB_EVENT_OVP) + +#endif /* __LINUX_USB_PD_EXT_SDB_H */ -- 1.9.1