From patchwork Tue Nov 14 11:44:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10057439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C3C486023A for ; Tue, 14 Nov 2017 11:46:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B137B2916B for ; Tue, 14 Nov 2017 11:46:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5E8429716; Tue, 14 Nov 2017 11:46:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FROM_WORDY, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3680B29711 for ; Tue, 14 Nov 2017 11:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755235AbdKNLpT (ORCPT ); Tue, 14 Nov 2017 06:45:19 -0500 Received: from mail1.bemta5.messagelabs.com ([195.245.231.145]:27514 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755199AbdKNLoz (ORCPT ); Tue, 14 Nov 2017 06:44:55 -0500 Received: from [85.158.139.51] by server-9.bemta-5.messagelabs.com id 1A/35-25868-137DA0A5; Tue, 14 Nov 2017 11:44:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleJIrShJLcpLzFFi42KJ27nUWFf3Ole UwYR+K4vmxevZLN4cn85k0bV6J4vF5V1z2Cw+9x5htFi0rJXZ4snCM0wWjQves1ic3l1i8ef5 LTYHLo+ds+6ye2xa1cnmMe9koMf+uWvYPd7vu8rmsfN7A7vH501yAexRrJl5SfkVCawZm94sZ iyYy13xcn11A+N3zi5GTg4hgfWMEvd3sHUxcgDZFRKflteChHkFMiVWrFrICmJzCrhLLG27yg pR7iZxfOU7RhCbTcBCYvKJB2CtLAKqEtNvWoKYwgLBElfbzLoYuThEBOYxSbzacJcNpJxZoE6 i9/dbFojxghInZz5hgYhLSBx88YIZYryBxOkFjWBxCQF7ienvrzKDzJQQ0JdoPBYLETaU+D7r G1SJucSZZRMZJzAKzkIydRaSqQsYmVYxahSnFpWlFukamuslFWWmZ5TkJmbm6BoamOrlphYXJ 6an5iQmFesl5+duYgRGCQMQ7GC8eNrzEKMkB5OSKK/KZ/YoIb6k/JTKjMTijPii0pzU4kOMMh wcShK8cde4ooQEi1LTUyvSMnOA8QqTluDgURLhjQVJ8xYXJOYWZ6ZDpE4x6nI8m/m6gVmIJS8 /L1VKnNcMpEgApCijNA9uBCx1XGKUlRLmZQQ6SoinILUoN7MEVf4VozgHo5IwrzfIFJ7MvBK4 Ta+AjmACOkIK5H7e4pJEhJRUA6NP/qIqp+OXdNaHC+sEuRf4Xvw2J8jceW/hvP1BC/Lll97x9 WsTPtRXYj1XYdLd4DauvYvqdgpbiyycY6WtuLf9Bc/nrZOXnje5U3JUPu5puV5BF8Omos17j+ +WEbqceiyqgWWn4kkDGx/hRMETrapVj3Ttnn3aU/vx5eZl05LuxOyaW/LLKUGJpTgj0VCLuag 4EQDPUX8aGAMAAA== X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-11.tower-180.messagelabs.com!1510659884!105299631!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21688 invoked from network); 14 Nov 2017 11:44:45 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-11.tower-180.messagelabs.com with AES128-SHA encrypted SMTP; 14 Nov 2017 11:44:45 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.248.2; Tue, 14 Nov 2017 11:44:44 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 4D5B73FBD0; Tue, 14 Nov 2017 11:44:44 +0000 (GMT) Message-ID: <73a1867b7ef5de11ddd0825827eba6bd1dd0b6ef.1510657748.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Tue, 14 Nov 2017 11:44:44 +0000 Subject: [RFC PATCH v2 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 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: 14/11/2017 09:42:00 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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..0eb83ce --- /dev/null +++ b/include/linux/usb/pd_ext_sdb.h @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2017 Dialog Semiconductor + * + * Author: Adam Thomson + */ + +#ifndef __LINUX_USB_PD_EXT_SDB_H +#define __LINUX_USB_PD_EXT_SDB_H + +/* SDB : Status Data Block */ +enum usb_pd_ext_sdb_fields { + USB_PD_EXT_SDB_INTERNAL_TEMP = 0, + USB_PD_EXT_SDB_PRESENT_INPUT, + USB_PD_EXT_SDB_PRESENT_BATT_INPUT, + USB_PD_EXT_SDB_EVENT_FLAGS, + USB_PD_EXT_SDB_TEMP_STATUS, + USB_PD_EXT_SDB_DATA_SIZE, +}; + +/* Event Flags */ +#define USB_PD_EXT_SDB_EVENT_OCP BIT(1) +#define USB_PD_EXT_SDB_EVENT_OTP BIT(2) +#define USB_PD_EXT_SDB_EVENT_OVP BIT(3) +#define USB_PD_EXT_SDB_EVENT_CF_CV_MODE BIT(4) + +#define USB_PD_EXT_SDB_PPS_EVENTS (USB_PD_EXT_SDB_EVENT_OCP | \ + USB_PD_EXT_SDB_EVENT_OTP | \ + USB_PD_EXT_SDB_EVENT_OVP) + +#endif /* __LINUX_USB_PD_EXT_SDB_H */