linux/drivers/clk/clk-si570.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for Silicon Labs Si570/Si571 Programmable XO/VCXO
 *
 * Copyright (C) 2010, 2011 Ericsson AB.
 * Copyright (C) 2011 Guenter Roeck.
 * Copyright (C) 2011 - 2021 Xilinx Inc.
 *
 * Author: Guenter Roeck <[email protected]>
 *	   Sören Brinkmann <[email protected]>
 */

#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/slab.h>

/* Si570 registers */
#define SI570_REG_HS_N1
#define SI570_REG_N1_RFREQ0
#define SI570_REG_RFREQ1
#define SI570_REG_RFREQ2
#define SI570_REG_RFREQ3
#define SI570_REG_RFREQ4
#define SI570_REG_CONTROL
#define SI570_REG_FREEZE_DCO
#define SI570_DIV_OFFSET_7PPM

#define HS_DIV_SHIFT
#define HS_DIV_MASK
#define HS_DIV_OFFSET
#define N1_6_2_MASK
#define N1_1_0_MASK
#define RFREQ_37_32_MASK

#define SI570_MIN_FREQ
#define SI570_MAX_FREQ
#define SI598_MAX_FREQ

#define FDCO_MIN
#define FDCO_MAX

#define SI570_CNTRL_RECALL
#define SI570_CNTRL_FREEZE_M
#define SI570_CNTRL_NEWFREQ

#define SI570_FREEZE_DCO

/**
 * struct clk_si570_info:
 * @max_freq:	Maximum frequency for this device
 * @has_temperature_stability: Device support temperature stability
 */
struct clk_si570_info {};

/**
 * struct clk_si570:
 * @hw:	Clock hw struct
 * @regmap:	Device's regmap
 * @div_offset:	Rgister offset for dividers
 * @info:	Device info
 * @fxtal:	Factory xtal frequency
 * @n1:		Clock divider N1
 * @hs_div:	Clock divider HSDIV
 * @rfreq:	Clock multiplier RFREQ
 * @frequency:	Current output frequency
 * @i2c_client:	I2C client pointer
 */
struct clk_si570 {};
#define to_clk_si570(_hw)

/**
 * si570_get_divs() - Read clock dividers from HW
 * @data:	Pointer to struct clk_si570
 * @rfreq:	Fractional multiplier (output)
 * @n1:		Divider N1 (output)
 * @hs_div:	Divider HSDIV (output)
 * Returns 0 on success, negative errno otherwise.
 *
 * Retrieve clock dividers and multipliers from the HW.
 */
static int si570_get_divs(struct clk_si570 *data, u64 *rfreq,
		unsigned int *n1, unsigned int *hs_div)
{}

/**
 * si570_get_defaults() - Get default values
 * @data:	Driver data structure
 * @fout:	Factory frequency output
 * @skip_recall:	If true, don't recall NVM into RAM
 * Returns 0 on success, negative errno otherwise.
 */
static int si570_get_defaults(struct clk_si570 *data, u64 fout,
			      bool skip_recall)
{}

/**
 * si570_update_rfreq() - Update clock multiplier
 * @data:	Driver data structure
 * Passes on regmap_bulk_write() return value.
 */
static int si570_update_rfreq(struct clk_si570 *data)
{}

/**
 * si570_calc_divs() - Caluclate clock dividers
 * @frequency:	Target frequency
 * @data:	Driver data structure
 * @out_rfreq:	RFREG fractional multiplier (output)
 * @out_n1:	Clock divider N1 (output)
 * @out_hs_div:	Clock divider HSDIV (output)
 * Returns 0 on success, negative errno otherwise.
 *
 * Calculate the clock dividers (@out_hs_div, @out_n1) and clock multiplier
 * (@out_rfreq) for a given target @frequency.
 */
static int si570_calc_divs(unsigned long frequency, struct clk_si570 *data,
		u64 *out_rfreq, unsigned int *out_n1, unsigned int *out_hs_div)
{}

static unsigned long si570_recalc_rate(struct clk_hw *hw,
		unsigned long parent_rate)
{}

static long si570_round_rate(struct clk_hw *hw, unsigned long rate,
		unsigned long *parent_rate)
{}

/**
 * si570_set_frequency() - Adjust output frequency
 * @data:	Driver data structure
 * @frequency:	Target frequency
 * Returns 0 on success.
 *
 * Update output frequency for big frequency changes (> 3,500 ppm).
 */
static int si570_set_frequency(struct clk_si570 *data, unsigned long frequency)
{}

/**
 * si570_set_frequency_small() - Adjust output frequency
 * @data:	Driver data structure
 * @frequency:	Target frequency
 * Returns 0 on success.
 *
 * Update output frequency for small frequency changes (< 3,500 ppm).
 */
static int si570_set_frequency_small(struct clk_si570 *data,
				     unsigned long frequency)
{}

static int si570_set_rate(struct clk_hw *hw, unsigned long rate,
		unsigned long parent_rate)
{}

static const struct clk_ops si570_clk_ops =;

static bool si570_regmap_is_volatile(struct device *dev, unsigned int reg)
{}

static bool si570_regmap_is_writeable(struct device *dev, unsigned int reg)
{}

static const struct regmap_config si570_regmap_config =;

static int si570_probe(struct i2c_client *client)
{}

static const struct clk_si570_info clk_si570_info =;

static const struct clk_si570_info clk_si590_info =;

static const struct i2c_device_id si570_id[] =;
MODULE_DEVICE_TABLE(i2c, si570_id);

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

static struct i2c_driver si570_driver =;
module_i2c_driver();

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