From patchwork Tue Jan 2 15:50:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10140961 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 AFF186035E for ; Tue, 2 Jan 2018 15:53:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98311285E1 for ; Tue, 2 Jan 2018 15:53:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CD9228604; Tue, 2 Jan 2018 15:53:01 +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=-4.4 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 2B9D3285E1 for ; Tue, 2 Jan 2018 15:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751425AbeABPwp (ORCPT ); Tue, 2 Jan 2018 10:52:45 -0500 Received: from mail1.bemta3.messagelabs.com ([195.245.230.165]:49519 "EHLO mail1.bemta3.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbeABPuz (ORCPT ); Tue, 2 Jan 2018 10:50:55 -0500 Received: from [85.158.137.99] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-5.bemta-3.messagelabs.com id 2A/2D-09120-C5AAB4A5; Tue, 02 Jan 2018 15:50:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMKsWRWlGSWpSXmKPExsUSt3OpsW7MKu8 og4knBCyaF69ns3hzfDqTRdfqnSwWl3fNYbP43HuE0WLRslZmiycLzzBZNC54z2JxeneJxZ/n t9gcuDx2zrrL7rFpVSebx7yTgR77565h93i/7yqbx87vDewenzfJBbBHsWbmJeVXJLBmbHqzm LFgLnfFy/XVDYzfObsYuTiEBNYxSnw4s4C9i5ETyKmQ+H3wHCOIzSuQKXH8wxagOAcHp4C7xN ZPzCCmkICbxKy3dSAVbAIWEpNPPGADsVkEVCQ2vZsLNkVYwF/i5/czrCDjRQTmMUm82nAXrIh ZoE6i9/dbFojxghInZz5hgYhLSBx88YIZ4gQDidMLGsHiEgL2EtPfXwXbKyGgL9F4LBYibCjx fdY3qBJziR23b7BOYBSchWTqLCRTFzAyrWLUKE4tKkst0jU01ksqykzPKMlNzMzRNTQw1stNL S5OTE/NSUwq1kvOz93ECIwUBiDYwbhtu+chRkkOJiVR3pxU7yghvqT8lMqMxOKM+KLSnNTiQ4 waHBwCLRdPHmSSYsnLz0tVkuC9vQKoTrAoNT21Ii0zBxjLMKUSHDxKIrzvQNK8xQWJucWZ6RC pU4y6HM9mvm5gFgKbISXOy7MSqEgApCijNA9uBCytXGKUlRLmZQQ6UIinILUoN7MEVf4VozgH o5Iw73uQVTyZeSVwm14BHcEEdMSf854gR5QkIqSkGhij5k3YybA++vzskpn5xj4HC67PefYx3 brDh1Fq4geTqBul/15xt2xi5utY8MK09/7ms0e2vb76Mu+NwP0Hqa+1/rZu813lyMCS/dX0h/ b1tdENstt6Wf5vt2/s9Rc8/C88nue9bXOxFCsHw8Y4n8srLkTY/m/cMjXywQKDjZJPw5cF8pa 83n5EiaU4I9FQi7moOBEAQeX52SYDAAA= X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-5.tower-217.messagelabs.com!1514908251!105021009!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6010 invoked from network); 2 Jan 2018 15:50:52 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-5.tower-217.messagelabs.com with AES128-SHA encrypted SMTP; 2 Jan 2018 15:50:52 -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, 2 Jan 2018 15:50:51 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 7EB303FBE8; Tue, 2 Jan 2018 15:50:51 +0000 (GMT) Message-ID: In-Reply-To: References: From: Adam Thomson Date: Tue, 2 Jan 2018 15:50:51 +0000 Subject: [PATCH v4 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: 02/01/2018 11:56: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 Acked-by: Heikki Krogerus --- 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 */