mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 12:29:44 +07:00
0c2d696456
There are a few known (minor) problems with having the support code for both I2C and SPI in the same module: * We need to be extra careful to make sure to not build the driver into the kernel if one of the subsystems is build as a module (Currently only I2C can be build as a module). * The module init path error handling is rather ugly. E.g. what should be done if either the SPI or the I2C driver fails to register. Most drivers that implement SPI and I2C in the same module currently fallback to undefined behavior in that case. Splitting the the driver into two modules, one for each bus, allows the registration of the other bus drive to continue without problems if one of them fails. This patch splits the ADAV80X driver into 3 modules. One core module that implements the device logic, but is independent of the bus method used. And one module for SPI and I2C each that registers the drivers and sets up the regmap struct for the bus. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
43 lines
714 B
C
43 lines
714 B
C
/*
|
|
* header file for ADAV80X parts
|
|
*
|
|
* Copyright 2011 Analog Devices Inc.
|
|
*
|
|
* Licensed under the GPL-2 or later.
|
|
*/
|
|
|
|
#ifndef _ADAV80X_H
|
|
#define _ADAV80X_H
|
|
|
|
#include <linux/regmap.h>
|
|
|
|
struct device;
|
|
|
|
extern const struct regmap_config adav80x_regmap_config;
|
|
int adav80x_bus_probe(struct device *dev, struct regmap *regmap);
|
|
|
|
enum adav80x_pll_src {
|
|
ADAV80X_PLL_SRC_XIN,
|
|
ADAV80X_PLL_SRC_XTAL,
|
|
ADAV80X_PLL_SRC_MCLKI,
|
|
};
|
|
|
|
enum adav80x_pll {
|
|
ADAV80X_PLL1 = 0,
|
|
ADAV80X_PLL2 = 1,
|
|
};
|
|
|
|
enum adav80x_clk_src {
|
|
ADAV80X_CLK_XIN = 0,
|
|
ADAV80X_CLK_MCLKI = 1,
|
|
ADAV80X_CLK_PLL1 = 2,
|
|
ADAV80X_CLK_PLL2 = 3,
|
|
ADAV80X_CLK_XTAL = 6,
|
|
|
|
ADAV80X_CLK_SYSCLK1 = 6,
|
|
ADAV80X_CLK_SYSCLK2 = 7,
|
|
ADAV80X_CLK_SYSCLK3 = 8,
|
|
};
|
|
|
|
#endif
|