linux/drivers/usb/misc/onboard_usb_dev.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for onboard USB devices
 *
 * Copyright (c) 2022, Google LLC
 */

#include <linux/clk.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/suspend.h>
#include <linux/sysfs.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include <linux/usb/onboard_dev.h>
#include <linux/workqueue.h>

#include "onboard_usb_dev.h"

static void onboard_dev_attach_usb_driver(struct work_struct *work);

static struct usb_device_driver onboard_dev_usbdev_driver;
static DECLARE_WORK(attach_usb_driver_work, onboard_dev_attach_usb_driver);

/************************** Platform driver **************************/

struct usbdev_node {};

struct onboard_dev {};

static int onboard_dev_get_regulators(struct onboard_dev *onboard_dev)
{}

static int onboard_dev_power_on(struct onboard_dev *onboard_dev)
{}

static int onboard_dev_power_off(struct onboard_dev *onboard_dev)
{}

static int __maybe_unused onboard_dev_suspend(struct device *dev)
{}

static int __maybe_unused onboard_dev_resume(struct device *dev)
{}

static inline void get_udev_link_name(const struct usb_device *udev, char *buf,
				      size_t size)
{}

static int onboard_dev_add_usbdev(struct onboard_dev *onboard_dev,
				  struct usb_device *udev)
{}

static void onboard_dev_remove_usbdev(struct onboard_dev *onboard_dev,
				      const struct usb_device *udev)
{}

static ssize_t always_powered_in_suspend_show(struct device *dev,
					      struct device_attribute *attr,
					      char *buf)
{}

static ssize_t always_powered_in_suspend_store(struct device *dev,
					       struct device_attribute *attr,
					       const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(always_powered_in_suspend);

static struct attribute *onboard_dev_attrs[] =;

static umode_t onboard_dev_attrs_are_visible(struct kobject *kobj,
					     struct attribute *attr,
					     int n)
{}

static const struct attribute_group onboard_dev_group =;
__ATTRIBUTE_GROUPS();


static void onboard_dev_attach_usb_driver(struct work_struct *work)
{}

static int onboard_dev_probe(struct platform_device *pdev)
{}

static void onboard_dev_remove(struct platform_device *pdev)
{}

MODULE_DEVICE_TABLE(of, onboard_dev_match);

static const struct dev_pm_ops __maybe_unused onboard_dev_pm_ops =;

static struct platform_driver onboard_dev_driver =;

/************************** USB driver **************************/

#define VENDOR_ID_CYPRESS
#define VENDOR_ID_GENESYS
#define VENDOR_ID_MICROCHIP
#define VENDOR_ID_REALTEK
#define VENDOR_ID_TI
#define VENDOR_ID_VIA
#define VENDOR_ID_XMOS

/*
 * Returns the onboard_dev platform device that is associated with the USB
 * device passed as parameter.
 */
static struct onboard_dev *_find_onboard_dev(struct device *dev)
{}

static bool onboard_dev_usbdev_match(struct usb_device *udev)
{}

static int onboard_dev_usbdev_probe(struct usb_device *udev)
{}

static void onboard_dev_usbdev_disconnect(struct usb_device *udev)
{}

static const struct usb_device_id onboard_dev_id_table[] =;
MODULE_DEVICE_TABLE(usb, onboard_dev_id_table);

static struct usb_device_driver onboard_dev_usbdev_driver =;

static int __init onboard_dev_init(void)
{}
module_init();

static void __exit onboard_dev_exit(void)
{}
module_exit(onboard_dev_exit);

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