2020-09-15 18:13:29 +01:00
|
|
|
/*
|
2020-10-20 08:42:57 +01:00
|
|
|
* USB-PD driver for Nintendo Switch's TI BM92T36
|
2020-09-15 18:13:29 +01:00
|
|
|
*
|
|
|
|
* Copyright (c) 2020 CTCaer
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-10-20 08:42:57 +01:00
|
|
|
#ifndef __BM92T36_H_
|
|
|
|
#define __BM92T36_H_
|
2020-09-15 18:13:29 +01:00
|
|
|
|
|
|
|
#include <utils/types.h>
|
|
|
|
|
2020-10-20 08:42:57 +01:00
|
|
|
#define BM92T36_I2C_ADDR 0x18
|
2020-09-15 18:13:29 +01:00
|
|
|
|
|
|
|
typedef struct _usb_pd_object_t
|
|
|
|
{
|
|
|
|
u32 amperage;
|
|
|
|
u32 voltage;
|
|
|
|
} usb_pd_object_t;
|
|
|
|
|
|
|
|
typedef struct _usb_pd_objects_t
|
|
|
|
{
|
|
|
|
u32 pdo_no;
|
|
|
|
usb_pd_object_t pdos[7];
|
2020-10-20 08:42:57 +01:00
|
|
|
usb_pd_object_t selected_pdo;
|
2020-09-15 18:13:29 +01:00
|
|
|
} usb_pd_objects_t;
|
|
|
|
|
2020-10-20 08:42:57 +01:00
|
|
|
void bm92t36_get_sink_info(bool *inserted, usb_pd_objects_t *usb_pd);
|
2020-09-15 18:13:29 +01:00
|
|
|
|
|
|
|
#endif
|