linux/include/linux/platform_data/lenovo-yoga-c630.h

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2022-2024, Linaro Ltd
 * Authors:
 *    Bjorn Andersson
 *    Dmitry Baryshkov
 */

#ifndef _LENOVO_YOGA_C630_DATA_H
#define _LENOVO_YOGA_C630_DATA_H

struct yoga_c630_ec;
struct notifier_block;

#define YOGA_C630_MOD_NAME

#define YOGA_C630_DEV_UCSI
#define YOGA_C630_DEV_PSY

int yoga_c630_ec_read8(struct yoga_c630_ec *ec, u8 addr);
int yoga_c630_ec_read16(struct yoga_c630_ec *ec, u8 addr);

int yoga_c630_ec_register_notify(struct yoga_c630_ec *ec, struct notifier_block *nb);
void yoga_c630_ec_unregister_notify(struct yoga_c630_ec *ec, struct notifier_block *nb);

#define YOGA_C630_UCSI_WRITE_SIZE
#define YOGA_C630_UCSI_CCI_SIZE
#define YOGA_C630_UCSI_DATA_SIZE
#define YOGA_C630_UCSI_READ_SIZE

u16 yoga_c630_ec_ucsi_get_version(struct yoga_c630_ec *ec);
int yoga_c630_ec_ucsi_write(struct yoga_c630_ec *ec,
			    const u8 req[YOGA_C630_UCSI_WRITE_SIZE]);
int yoga_c630_ec_ucsi_read(struct yoga_c630_ec *ec,
			   u8 resp[YOGA_C630_UCSI_READ_SIZE]);

#define LENOVO_EC_EVENT_USB
#define LENOVO_EC_EVENT_UCSI
#define LENOVO_EC_EVENT_HPD
#define LENOVO_EC_EVENT_BAT_STATUS
#define LENOVO_EC_EVENT_BAT_INFO
#define LENOVO_EC_EVENT_BAT_ADPT_STATUS

#endif