linux/drivers/platform/x86/intel/chtwc_int33fe.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Intel Cherry Trail ACPI INT33FE pseudo device driver
 *
 * Copyright (C) 2017 Hans de Goede <[email protected]>
 *
 * Some Intel Cherry Trail based device which ship with Windows 10, have
 * this weird INT33FE ACPI device with a CRS table with 4 I2cSerialBusV2
 * resources, for 4 different chips attached to various I²C buses:
 * 1. The Whiskey Cove PMIC, which is also described by the INT34D3 ACPI device
 * 2. Maxim MAX17047 Fuel Gauge Controller
 * 3. FUSB302 USB Type-C Controller
 * 4. PI3USB30532 USB switch
 *
 * So this driver is a stub / pseudo driver whose only purpose is to
 * instantiate I²C clients for chips 2 - 4, so that standard I²C drivers
 * for these chips can bind to the them.
 */

#include <linux/dmi.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/usb/pd.h>

struct cht_int33fe_data {};

/*
 * Grrr, I severely dislike buggy BIOS-es. At least one BIOS enumerates
 * the max17047 both through the INT33FE ACPI device (it is right there
 * in the resources table) as well as through a separate MAX17047 device.
 *
 * These helpers are used to work around this by checking if an I²C client
 * for the max17047 has already been registered.
 */
static int cht_int33fe_check_for_max17047(struct device *dev, void *data)
{}

static const char * const max17047_suppliers[] =;

static const struct property_entry max17047_properties[] =;

static const struct software_node max17047_node =;

/*
 * We are not using inline property here because those are constant,
 * and we need to adjust this one at runtime to point to real
 * software node.
 */
static struct software_node_ref_args fusb302_mux_refs[] =;

static const struct property_entry fusb302_properties[] =;

static const struct software_node fusb302_node =;

#define PDO_FIXED_FLAGS

static const u32 src_pdo[] =;

static const u32 snk_pdo[] =;

static const struct software_node pi3usb30532_node =;

static const struct software_node displayport_node =;

static const struct property_entry usb_connector_properties[] =;

static const struct software_node usb_connector_node =;

static const struct software_node altmodes_node =;

static const struct property_entry dp_altmode_properties[] =;

static const struct software_node dp_altmode_node =;

static const struct software_node *node_group[] =;

static int cht_int33fe_setup_dp(struct cht_int33fe_data *data)
{}

static void cht_int33fe_remove_nodes(struct cht_int33fe_data *data)
{}

static int cht_int33fe_add_nodes(struct cht_int33fe_data *data)
{}

static int
cht_int33fe_register_max17047(struct device *dev, struct cht_int33fe_data *data)
{}

static const struct dmi_system_id cht_int33fe_typec_ids[] =;
MODULE_DEVICE_TABLE(dmi, cht_int33fe_typec_ids);

static int cht_int33fe_typec_probe(struct platform_device *pdev)
{}

static void cht_int33fe_typec_remove(struct platform_device *pdev)
{}

static const struct acpi_device_id cht_int33fe_acpi_ids[] =;

static struct platform_driver cht_int33fe_typec_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();