linux/drivers/mfd/mc13xxx-spi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2009-2010 Pengutronix
 * Uwe Kleine-Koenig <[email protected]>
 *
 * loosely based on an earlier driver that has
 * Copyright 2009 Pengutronix, Sascha Hauer <[email protected]>
 */

#include <linux/slab.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
#include <linux/mfd/mc13xxx.h>
#include <linux/err.h>
#include <linux/spi/spi.h>

#include "mc13xxx.h"

static const struct spi_device_id mc13xxx_device_id[] =;
MODULE_DEVICE_TABLE(spi, mc13xxx_device_id);

static const struct of_device_id mc13xxx_dt_ids[] =;
MODULE_DEVICE_TABLE(of, mc13xxx_dt_ids);

static const struct regmap_config mc13xxx_regmap_spi_config =;

static int mc13xxx_spi_read(void *context, const void *reg, size_t reg_size,
				void *val, size_t val_size)
{}

static int mc13xxx_spi_write(void *context, const void *data, size_t count)
{}

/*
 * We cannot use regmap-spi generic bus implementation here.
 * The MC13783 chip will get corrupted if CS signal is deasserted
 * and on i.Mx31 SoC (the target SoC for MC13783 PMIC) the SPI controller
 * has the following errata (DSPhl22960):
 * "The CSPI negates SS when the FIFO becomes empty with
 * SSCTL= 0. Software cannot guarantee that the FIFO will not
 * drain because of higher priority interrupts and the
 * non-realtime characteristics of the operating system. As a
 * result, the SS will negate before all of the data has been
 * transferred to/from the peripheral."
 * We workaround this by accessing the SPI controller with a
 * single transfer.
 */

static const struct regmap_bus regmap_mc13xxx_bus =;

static int mc13xxx_spi_probe(struct spi_device *spi)
{}

static void mc13xxx_spi_remove(struct spi_device *spi)
{}

static struct spi_driver mc13xxx_spi_driver =;

static int __init mc13xxx_init(void)
{}
subsys_initcall(mc13xxx_init);

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

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