1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-09 20:11:50 +00:00
hekate/bdk/power/bm92t30_stub.h
CTCaer 8b837dd81b bm92t30 Add USB-PD driver stub
TODO:
This driver is a stub and relies on incorrect I2C requests.
The I2C driver needs to be updated with proper multi-xfer support.

For now it replies its whole register range, according to request size.
That's because the IC does not support the classic single transfer request-response style.
2020-09-15 20:13:29 +03:00

40 lines
1 KiB
C

/*
* USB-PD driver for Nintendo Switch's TI BM92T30
*
* 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/>.
*/
#ifndef __BM92T30_H_
#define __BM92T30_H_
#include <utils/types.h>
#define BM92T30_I2C_ADDR 0x18
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];
} usb_pd_objects_t;
void bm92t30_get_charger_type(bool *inserted, usb_pd_objects_t *usb_pd);
#endif