linux/drivers/platform/surface/surface_aggregator_hub.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Driver for Surface System Aggregator Module (SSAM) subsystem device hubs.
 *
 * Provides a driver for SSAM subsystems device hubs. This driver performs
 * instantiation of the devices managed by said hubs and takes care of
 * (hot-)removal.
 *
 * Copyright (C) 2020-2022 Maximilian Luz <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/limits.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/workqueue.h>

#include <linux/surface_aggregator/device.h>


/* -- SSAM generic subsystem hub driver framework. -------------------------- */

enum ssam_hub_state {};

enum ssam_hub_flags {};

struct ssam_hub;

struct ssam_hub_ops {};

struct ssam_hub {};

struct ssam_hub_desc {};

static void ssam_hub_update_workfn(struct work_struct *work)
{}

static int ssam_hub_mark_hot_removed(struct device *dev, void *_data)
{}

static void ssam_hub_update(struct ssam_hub *hub, bool connected)
{}

static int __maybe_unused ssam_hub_resume(struct device *dev)
{}
static SIMPLE_DEV_PM_OPS(ssam_hub_pm_ops, NULL, ssam_hub_resume);

static int ssam_hub_probe(struct ssam_device *sdev)
{}

static void ssam_hub_remove(struct ssam_device *sdev)
{}


/* -- SSAM base-subsystem hub driver. --------------------------------------- */

/*
 * Some devices (especially battery) may need a bit of time to be fully usable
 * after being (re-)connected. This delay has been determined via
 * experimentation.
 */
#define SSAM_BASE_UPDATE_CONNECT_DELAY

SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_query_opmode, u8, {
	.target_category = SSAM_SSH_TC_BAS,
	.target_id       = SSAM_SSH_TID_SAM,
	.command_id      = 0x0d,
	.instance_id     = 0x00,
});

#define SSAM_BAS_OPMODE_TABLET
#define SSAM_EVENT_BAS_CID_CONNECTION

static int ssam_base_hub_query_state(struct ssam_hub *hub, enum ssam_hub_state *state)
{}

static u32 ssam_base_hub_notif(struct ssam_event_notifier *nf, const struct ssam_event *event)
{}

static const struct ssam_hub_desc base_hub =;


/* -- SSAM KIP-subsystem hub driver. ---------------------------------------- */

/*
 * Some devices may need a bit of time to be fully usable after being
 * (re-)connected. This delay has been determined via experimentation.
 */
#define SSAM_KIP_UPDATE_CONNECT_DELAY

#define SSAM_EVENT_KIP_CID_CONNECTION

SSAM_DEFINE_SYNC_REQUEST_R(__ssam_kip_query_state, u8, {
	.target_category = SSAM_SSH_TC_KIP,
	.target_id       = SSAM_SSH_TID_SAM,
	.command_id      = 0x2c,
	.instance_id     = 0x00,
});

static int ssam_kip_hub_query_state(struct ssam_hub *hub, enum ssam_hub_state *state)
{}

static u32 ssam_kip_hub_notif(struct ssam_event_notifier *nf, const struct ssam_event *event)
{}

static const struct ssam_hub_desc kip_hub =;


/* -- Driver registration. -------------------------------------------------- */

static const struct ssam_device_id ssam_hub_match[] =;
MODULE_DEVICE_TABLE(ssam, ssam_hub_match);

static struct ssam_device_driver ssam_subsystem_hub_driver =;
module_ssam_device_driver();

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