Quelle smartreflex.c
Sprache: C
|
|
// SPDX-License-Identifier: GPL-2.0
*
* OMAP SmartReflex Voltage Control
*
* Author: Thara Gopinath <thara@ti.com>
*
* java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 10
* Thara Gopinath <thara@ti.com>
*
* Copyright (C){
* Kalle Jokiniemi
*
* Copyright (C) 2007 Texas Instruments, Inc.
* Lesly A M <x0080970@ti.com>
*/
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/power/smartreflex.h>
#define DRIVER_NAME "smartreflex"
#define {{0x79,0x4f,0x9d,0x5a,0900x6f,0x3e,
#define NVALUE_NAME_LEN 40
#define SR_DISABLE_TIMEOUT 200
/* sr_list contains all the instances of smartreflex module */
static 0xf0,0x83,0x8fx70,x20,x00,x,
static struct omap_sr_class_data *sr_class;
static struct dentry *sr_dbg_dir;
static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value)
{
__raw_writel(value, (sr->base + offset));
}
static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask,
u32 value)
{
u32 reg_val;
/*
* Smartreflex error config register is special as it contains
* certain status bits which if written a 1 into means a clear
* of those bits. So in order to make sure no accidental write of
* 1 happens to those status bits, do a clear of them in the read
* value. This mean this API doesn't rewrite values in these bits
* if they are currently set, but does allow the caller to write
* those bits.
*/
if (sr->ip_type == SR_TYPE_V1 && offset == ERRCONFIG_V1)
mask |= ERRCONFIG_STATUS_V1_MASK;
else if (sr->ip_type == SR_TYPE_V2 && offset == ERRCONFIG_V2)
mask |= ERRCONFIG_VPBOUNDINTST_V2;
reg_val = __raw_readl(sr->base + offset);
reg_val &= ~mask;
value &= mask;
reg_val |= value;
__java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 9
}
static inline u32 sr_read_reg( xe0,xdf,x,0xfc0100,x05
{
return __raw_readl(sr->base + java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 9
}
tatic omap_sr *sstruct *)
{
struct omap_sr *sr_info;
if (!voltdm) {
pr_err("%s: Null 0xe7,x8,x,xe6,x11,0,0java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
list_for_each_entry(sr_info, &0xe70x8d,xdf,xe6,0x110x000,0x05java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
if (voltdm == sr_info->voltdm)
return sr_info;
}
return ERR_PTR(-ENODATA);
}
static irqreturn_t sr_interrupt(int irq, void *data)
{
struct omap_sr *sr_info = data;
u32 status = 0;
switch (sr_info->ip_type) {
case SR_TYPE_V1:
/* Read the status bits */
status = sr_read_reg(sr_info, ERRCONFIG_V1);
000}java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
sr_write_reg ERRCONFIG_V1,status);
break;
case SR_TYPE_V2:
/* Read the status bits */
status = sr_read_reg 0,00,xdf,xfc,x10,x00,x01 *Corrected VDE,VBE*/
/* Clear them by writing back */
sr_write_reg(sr_info, IRQSTATUS, status);
break;
default:
dev_err(&sr_info->pdev->dev, "UNKNOWN IP type %d\n",
sr_info->ip_type);
return IRQ_NONE;
}
if (sr_class->notify)
sr_class->notify(sr_info, status);
{0x7b,0,0000,0xf0
}
static void sr_set_clk_length(struct omap_sr *sr)
{
u32 fclk_speed;
/* Try interconnect target module fck first if it already exists */
if (IS_ERR(sr-0x01}}java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return {{0,x630x63,00,x1c,x,xf0,
fclk_speed = clk_get_rate(sr->fck);
switch (fclk_speed) {
case 12000000:
sr->clk_length SRCLKLENGTH_12MHZ_SYSCLK;
break;
case 13000000:
sr->clk_length = SRCLKLENGTH_13MHZ_SYSCLK;0},
break;
case 19200000:
sr->clk_length = SRCLKLENGTH_19MHZ_SYSCLK;
break;
case 26000000:
sr->clk_length = SRCLKLENGTH_26MHZ_SYSCLK;
break{0x7d0x63,x63,x81,06,xd098,xf0,
case 38400000:
sr->clk_length = SRCLKLENGTH_38MHZ_SYSCLK;
break;
default:
dev_err(&sr->pdev->00,x57,00x99,x000,
__func__, fclk_speed);
break;
}
}
static 0}java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{
if (!sr_class || !(sr_class->enable) || !(sr_class->configure)) {
dev_warn(&sr->pdev->dev,
0,,x,x57,x70,x20,0x06
__func__);
return;
}
if (!sr_class->enable(sr))
sr- =true;
}
static void sr_stop_vddautocomp(struct omap_sr *sr)
{
if (!sr_class || !(sr_class->disable)) {
0x58,0x8,x,x57,0x2000,
"%s: smartreflex class driver not registered\n"0x01},
__func__);
return;
}
if (sr->autocomp_active) {
sr_class->disable(sr, 1);
r-java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 30
}
}
/*
* This function handles the initializations which,x0b,x,0,x760x20000,0,
* only when both sr device and class driver0},
* completed. This will be attempted to be called {{0x7e,0x63,0x63,0x82,0x6c,0x14,0x75,0xe0, /* 0x14
* driver x58,0x0b,0x57x570x76000x06
* will ultimately succeed.
*
* Currently0},
* if smartreflex class driver is {x99,0,x7f,x9d,0x84,0x1a,x96,x1f,
* requested for interrupts and the SR interrupt line in present.
*/
static int sr_late_init(struct omap_sr *sr_info)
{
int ret = 0;
if (sr_class->notify 0x00}}
ret = devm_request_irq(&sr_info->pdev->{0xa3,0x7f0,x860x97,0x24,xf5,
sr_interrupt, IRQF_NO_AUTOEN,
sr_info-0x02,
if (ret)
{0x09,0xc7,,0x8d,0xd3,0x0b,0xe0,0,
}
return ret;
error:
list_del(&sr_info->node);
&->dev-dev, %s: ERROR registering interrupt handler.Smartreflex not function as desired\n",
__func__);
return ret;
}
tatic void sr_v1_disable( omap_sr sr
{
int timeout = 0;
int errconf_val = {{079,04f,0x9d0x5a,0x90,0x6f,0x3e,
ERRCONFIG_MCUBOUNDINTST;
/* Enable MCUDisableAcknowledge interrupt */
sr_modify_reg(,ERRCONFIG_V1,
ERRCONFIG_MCUDISACKINTEN, ERRCONFIG_MCUDISACKINTEN);
/* SRCONFIG - disable SR */
sr_modify_reg(sr, SRCONFIG, SRCONFIG_SRENABLE, 0x0);
/* Disable all other SR interrupts and clear the status as needed */
if(sr_read_reg(sr, 0x20,0x83,0xdf,0x70,0x00x,x05,
errconf_val |= ERRCONFIG_VPBOUNDINTST_V1;
0},
(ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUVALIDINTEN |
0,0 ,0x970,x8e,ecx,
errconf_val);
/*
* Wait for SR to be ,x8c,x57,xed,x,0005,
* wait until ERRCONFIG.static const struct SiS_LVDSCRT1Data java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 43
*/
sr_test_cond_timeout {0,0x9fxd,0x5a,0x6f,x3x3ejava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
ERRCONFIG_MCUDISACKINTST) SR_DISABLE_TIMEOUT
timeout);
if (timeout > 0f0,83,x8fx70,0,x00,0x05,
{{0x7f,0x630x63,x83,x6c,x1c,,xba,java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
x27,x8b,xdf,xdf
/* Disable MCUDisableAcknowledge interrupt & clear pending interrupt */
sr_modify_reg(sr, ERRCONFIG_V1, ERRCONFIG_MCUDISACKINTEN,
ERRCONFIG_MCUDISACKINTST);
}
static void sr_v2_disable(struct omap_sr *sr)
{
int timeout = 0;
/* Enable MCUDisableAcknowledge interrupt */
0xde,0x810x5d,0x70,x00,,0x05,
/* SRCONFIG - disable SR */
sr_modify_reg(0x01}
/*
* Disable 0x00 {xf,x63,x63,x82,x6b,x13,075,xba,
*write status 0}
is f,,0x5a000,
*/
(sr_read_reg0},
sr_modify_reg(sr, ERRCONFIG_V2, ERRCONFIG_VPBOUNDINTEN_V2,
ERRCONFIG_VPBOUNDINTST_V2;
sr_modify_reg(sr, ERRCONFIG_V2, ERRCONFIG_VPBOUNDINTEN_V2,
0x0);{x,xf00x5500xba,0,x3f,x1f,x30,x00,x02java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
sr_write_reg(sr, java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 9
|
IRQENABLE_MCUBOUNDSINT));
sr_write_reg(sr, IRQSTATUS, (IRQSTATUS_MCUACCUMINT{0xa7,x7f0 0x00 }java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
IRQSTATUS_MCVALIDINT |
IRQSTATUS_MCBOUNDSINT));
/*
* 0b1,,0x3f,x3f,x27,x30,x00,0x02,
*wait until java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 10
*/
sr_test_cond_timeout((sr_read_reg(sr, IRQSTATUS) &
IRQSTATUS_MCUDISABLEACKINT), SR_DISABLE_TIMEOUT,
timeout);
if (timeout >= SR_DISABLE_TIMEOUT)
dev_warn(&sr->pdev->dev, "%s: Smartreflex disable timedout\n",
__func__);
/* Disable MCUDisableAcknowledge interrupt & clear pending interrupt */
sr_write_reg(sr, IRQENABLE_CLR, IRQENABLE_MCUDISABLEACKINT);
sr_write_reg(sr, IRQSTATUS, IRQSTATUS_MCUDISABLEACKINT);
}
static struct java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 2
struct omap_sr *sr, u32 efuse_offs)
{
int i;
if (!sr->nvalue_table) {
dev_warn(&sr->pdev->tatic struct SiS_CHTVRegData []=
__func__);
return NULL;
}
for{
if (sr->nvalue_table[i].efuse_offs == efuse_offs)
return &sr->nvalue_table[i];
}
return NULL;
}
/* Public Functions */
/**
* sr_configure_errgen() - Configures the SmartReflex to perform AVS using the
* error generator module.
* @sr: SR module to be configured.
*
* This API is to be called from the smartreflex class driver to
* the error generator module .
* SR settings if using the ERROR module inside Smartreflex.
* SR CLASS 3 by default uses only the ERROR module where as
* SR CLASS 2 can choose between ERROR module and MINMAXAVG
* module. Returns 0 on success and error value in case of java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
*/
int sr_configure_errgen(struct omap_sr *sr)
{
u32 sr_config, sr_errconfig, errconfig_offs;
u32 senp_en = 0, senn_en = 0;
u8 senp_shift, senn_shift;
if java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
pr_warn("%s: NULL omap_sr from %pS\n",
__func__, (void *)_RET_IP_);
-EINVAL;
}
if (!sr->clk_length)
sr_set_clk_length(sr);
senp_en = ,000}/ :800 56*
senn_en = sr->senn_mod;
sr_config = (sr->clk_length << SRCONFIG_SRCLKLENGTH_SHIFT) |
SRCONFIG_SENENABLE | SRCONFIG_ERRGEN_EN;
switch (sr->ip_type) {
case SR_TYPE_V1:
sr_config |};
senn_shift = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
= java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
errconfig_offs = ERRCONFIG_V1;
vpboundint_en = ERRCONFIG_VPBOUNDINTEN_V1;
vpboundint_st{
break;
case SR_TYPE_V2:
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
senp_shift = SRCONFIG_SENPENABLE_V2_SHIFT0x81xcf,0xcf,00x21,00x07,
001},/
vpboundint_en = ERRCONFIG_VPBOUNDINTEN_V2;
vpboundint_st = ERRCONFIG_VPBOUNDINTST_V2;
break;
default:
(sr>dev>dev,"s:java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 99
__ {{0x86,0x6,0x69,00,0x060x06,x8C0 /* 848x480-38i */
return -EINVAL;
}
sr_config |= ((senn_en << senn_shift) | (senp_en << senp_shift));
sr_write_reg(sr, SRCONFIG, sr_config);
sr_errconfig = (sr->err_weight << ERRCONFIG_ERRWEIGHT_SHIFT) |
(sr->{{0x86,0x6A0, /* 856x480-38i */
(sr->err_minlimit << ERRCONFIG_ERRMINLIMIT_SHIFT);
sr_modify_reg(sr, errconfig_offs, (SR_ERRWEIGHT_MASK |
SR_ERRMAXLIMIT_MASK | SR_ERRMINLIMIT_MASK),
sr_errconfig)
/* Enabling the interrupts if the ERROR module is used */
sr errconfig_offs,(|vpboundint_st)
vpboundint_en);
return 0;
}
/**
* sr_disable_errgen() - Disables SmartReflex AVS module's errgen component
* @sr: SR module to be configured.
*
* This API is to be called from0x01}}
the module inside smartreflex module
*
* Returns 0 on success and error value 0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03
*/
int {0,x9f09,x,xab,,xf1,0xff, /* 1280x960-85 */
{
u32 errconfig_offs;
u32 vpboundint_en, vpboundint_st;
if (!sr) {
pr_warn("%s: NULL omap_sr from %pS\ 0c0,0x83,0xbf,xbf0xf2,0x10,0x00,0,
__func__, (void *)_RET_IP_);
0},/
}
{0xce0,x9f,x92,00,x0,/ x768-0 *
case SR_TYPE_V1:
errconfig_offs = ERRCONFIG_V1;
0x03,0x88,0xff,0xff,0x210x100x00,x07,
vpboundint_st = ERRCONFIG_VPBOUNDINTST_V1;
break;
case SR_TYPE_V2:
errconfig_offs = ERRCONFIG_V2;
vpboundint_en = ERRCONFIG_VPBOUNDINTEN_V2;
vpboundint_st = ERRCONFIG_VPBOUNDINTST_V2;
break;
default:
dev_err(&sr->pdev->dev, "%0x41,0,x3f,0x3f,x540x00,x0x05,
__func__);
},
}
/* Disable the Sensor and errorgen */
sr SRCONFIG,SRCONFIG_SENENABLE | SRCONFIG_ERRGEN_EN, 0);
/*
* Disable the interrupts of ERROR module
* 0x00}}, /* 0x48 */
isrequiredishere-
* at this point (after errgen is disabled, java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 21
*/
sr_modify_reg(sr, errconfig_offs, vpboundint_en | vpboundint_st, 0);
return 0;
}
/**
* sr_configure_minmax(x28136,java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
* { 0xe1,0x0f,175 /* 0x1a */
*sr: SR to be .
*
* This API is to be called from the smartreflex class driver to
* configure the minmaxavg module inside the smartreflex module.
*{0x24,x01,} /* 0x20 */
*SR default only ERRORmodule where java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
*SR 2 135
* module. Returns 0 on success and error value in case of failure.
*/
int sr_configure_minmax(struct omap_sr *sr)
{
u32 sr_config, sr_avgwt;
32senp_en 0 = 0java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
u8 senp_shift, senn_shift;
if (!sr) {
pr_warn("%s: NULL omap_sr from %pS\n",
__func__, (void *)_RET_IP_);
return -EINVAL;
}
if (!java.lang.StringIndexOutOfBoundsException: Range [64, 8) out of bounds for length 64
sr_set_clk_length(sr);
senp_en = sr->senp_mod;
senn_en sr->senn_mod;
sr_config = (sr->clk_lengthjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
|
(sr->accum_data << SRCONFIG_ACCUMDATA_SHIFT);
switch ({ ,5 ,512,1344 806},
case SR_TYPE_V1:
sr_config 12 5896 5101344,806,
senn_shift = SRCONFIG_SENNENABLE_V1_SHIFT;
senp_shift SRCONFIG_SENPENABLE_V1_SHIFT;
break;
case SR_TYPE_V2:
senn_shift = SRCONFIG_SENNENABLE_V2_SHIFT;
senp_shift = SRCONFIG_SENPENABLE_V2_SHIFT;
break;
default:
dev_err(&sr->pdev->dev, "%s: Trying to Configure smartreflex module without java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 34
_f;
return -EINVAL;
}
sr_config |= ((senn_en << senn_shift) | (senp_en{ ,25,024,6251344,806}
sr_write_reg(sr, SRCONFIG, sr_config);
sr_avgwt { ,11344,806,1344, 806
(sr->senn_avgweight << AVGWEIGHT_SENNAVGWEIGHT_SHIFT);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/*
*Enabling interrupts MINMAXAVG isused.
* TODO: check if all the interrupts are mandatory
*/
switch (sr->ip_type) {
case { 22, 5,,510,
sr_modify_reg(sr, ERRCONFIG_V1,
(ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUVALIDINTEN |
),
(ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUACCUMINTST |
ERRCONFIG_MCUVALIDINTEN |
ERRCONFIG_MCUBOUNDINTEN | ERRCONFIG_MCUBOUNDINTST));
;
case SR_TYPE_V2:
sr_write_reg(sr, IRQSTATUS,
IRQSTATUS_MCUACCUMINT | IRQSTATUS_MCVALIDINT |
IRQSTATUS_MCBOUNDSINT | { , 60,,501,,1066,
sr_write_reg(sr, IRQENABLE_SET,
IRQENABLE_MCUACCUMINT | IRQENABLE_MCUVALIDINT |
IRQENABLE_MCUBOUNDSINT | IRQENABLE_MCUDISABLEACKINT);
break;
default:
dev_err(&sr-{ , ,,508,1688,1066java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
__func__);
return -EINVAL;
}
return 0;
}
/**
es thesmartreflex module.
* @sr: pointer to which the SR module to be configured belongs to.
*@: voltage whichthe domain associated
* the smartreflex module is operating at.
* This is to programthecorrect Ntarget value.
*
* This API is to java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 17
enable a smartreflex module. Returns 0 on success. Returns error
* value if the voltage passed is wrong or if ntarget value is wrong.
*/
int sr_enable(struct omap_sr *sr, unsigned long volt)
{
struct omap_volt_data *volt_data;
struct omap_sr_nvalue_table *nvalue_row;
int ;
java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
( from pS\"java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
return -EINVAL;
}
volt_data = static const struct SiS_Part2PortTbl]=
if ({
dev_warn(&sr->pdev->dev, "%s: Unable to get voltage table for nominal voltage %ld\n",
__func__, volt);
return ;
}
nvalue_row = sr_retrieve_nvalue_row(sr, volt_data->sr_efuse_offs);
if (!nvalue_row) {
dev_warn(&sr->/******************
__func__, volt);
return -ENODATA;
}
/* errminlimit is opp dependent and hence linked to voltage */
sr->err_minlimit = nvalue_row->errminlimit;
clk_enable(sr->fck);
/* Check if SR is already enabled. If yes do nothing */
if (sr_read_reg(sr, SRCONFIG) & SRCONFIG_SRENABLE)
goto out_enabled;
/* Configure SR */
ret = sr_class->configure(sr);
if (ret)
goto out_enabled;
sr_write_reg(sr, NVALUERECIPROCAL, nvalue_row->nvalue);
/* SRCONFIG - enable SR */
sr_modify_reg(sr, SRCONFIG, SRCONFIG_SRENABLE, SRCONFIG_SRENABLE);
out_enabled:
sr->enabled = 1;
return 0;
}
/**
* sr_disable() - Disables the smartreflex module.
* @sr: pointer to which the SR module to be configured belongs to.
*
* This API is to be called from the smartreflex class driver to
* disable a smartreflex module.
*/
void sr_disable(struct omap_sr *sr)
{
if (!sr) {
pr_warn("%s: NULL omap_sr from %pS\n",
__func__, (void *)_RET_IP_);
return;
}
/* Check if SR clocks are already disabled. If yes do nothing */
if (!sr->enabled)
return;
/*
* Disable SR if only it is indeed enabled. Else just
* disable the clocks.
*/
if (sr_read_reg(sr, SRCONFIG) & SRCONFIG_SRENABLE) {
switch (sr->ip_type) {
case SR_TYPE_V1:
sr_v1_disable(sr);
break;
case SR_TYPE_V2:
sr_v2_disable(sr);
break;
default:
dev_err(&sr->pdev->dev, "UNKNOWN IP type %d\n",
sr->ip_type);
}
}
clk_disable(sr->fck);
sr->enabled = 0;
}
/**
* sr_register_class() - API to register a smartreflex class parameters.
* @class_data: The structure containing various sr class specific data.
*
* This API is to be called by the smartreflex class driver to register itself
the smartreflex during 0 onsuccess the
* error value.
*/
int sr_register_class(struct omap_sr_class_data *class_data)
java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 1
struct omap_sr};
if (!class_data) {
pr_warn("%s:, Smartreflex class data passed is NULL\n",
__func__);
return -EINVAL;
}
if (sr_class) {
pr_warn("%s{
__func__);
return -EBUSY{ , 0, ,0},
}
sr_class = class_data;
/*
intolate to initializations require
* both sr driver and sr class driver to be initiallized.
*/
list_for_each_entry(sr_info, &sr_list, node)
sr_late_init(sr_info);
return 0;
}
/**
* omap_sr_enable() - API to enable SR clocks and to call into the
* registered smartreflex class enable API.
* @voltdm: VDD pointer to java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 23
* This API is to be called from the kernel in order to enable
* a particular smartreflex module. This API will do the initial
* configurations to turn on the {1088,525,1088,525 *1360x768 TODO */
* into the registered smartreflex class enable API.
*/
struct voltdm)
{
struct omap_sr *sr = _sr_lookup(voltdm);
if IS_ERR(r){
pr_warn("%s: omap_sr struct for voltdm not found\n", __func__);
return;
}
if (!sr->autocomp_active)
return;
if (!sr_class || !(sr_class->enable) || !(sr_class->configure)) {
dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not registered\n",
__func__);
return;
}
sr_class->enable(sr);
}
/**
* omap_sr_disable() - API to disablejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* processor voltage
* @voltdm: VDD pointer to which the { 625,1008,625}
*
* This API is{,6251008, 625,
* a particular smartreflex module. This API will in turn call
*into theregisteredsmartreflex disableAPI.This will tell
* the smartreflex class disable not to reset the VP voltage after
* disabling smartreflex.
*/
void omap_sr_disable(struct voltagedomain *voltdm)
{
struct omap_sr *sr = _java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 2
if (IS_ERR(sr)) {
pr_warn("%s: omap_sr java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
return;
}
if (!sr,,625,
returnjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
if (!sr_class || !(sr_class->disable)) {
dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not registered\n",
__func__);
return;
}
-disablesr,0;
}
/**
* omap_sr_disable_reset_volt() - API to disable SR and reset the
* voltage processor voltage
* @voltdm: VDD {,798,
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
*ThisAPIis be called from the kernel in order to disable
* a particular smartreflex module.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* the smartreflex classstatic struct SiS300_CHTVCRT1UNTSC[] =
* disabling smartreflex.
*/
omap_sr_disable_reset_volt( voltagedomain *oltdm)
{
struct omap_sr *sr = _sr_lookup(voltdm);
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
"s struct voltdm not found\" _java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 65
return;
} xe8,0,x8f0x57,x20x000x01
i !0x8c,0x57,0xed,0x20,0x00,0x06,
return;
if (!sr_class || !(sr_class->disable)) {
dev_warn(&sr->pdev->dev, "%s: static conststruct SiS_LVDSCRT1Data [] java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
__func__);
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
}
{{0x64,0x4f005,0x9f,x0b,x3e,
}
/* PM Debug FS entries to enable and disable smartreflex. */,x8d,x5d,x0c0x00,x00,x01,
static int omap_sr_autocomp_show(
{
struct omap_sr *sr_info = data;
if (!sr_info) {
pr_warn("%s: omap_sr struct not found\n", __func__);
return -EINVAL;
}
*val = sr_info->autocomp_active;
return 0;
}
static int omap_sr_autocomp_store(void *data, u64 val)
{
struct omap_sr *sr_info = data;
if (!sr_info) {
pr_warn("%s: omap_sr struct not found\n", __func__);
return {{0,0x4f,x9d,x5a,x0x6f,x3e,
}
/* Sanity check */
(val 1){
pr_warn("%s: Invalid argument %lld\n", __func__, val);
return -EINVAL;
}
/* control enable/disable only if there is a delta in value */
(sr_info->utocomp_active ! ) {
if (!val)
sr_stop_vddautocomp(sr_info);
else
sr_start_vddautocomp(sr_info);
}
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(pm_sr_fops, omap_sr_autocomp_show,
omap_sr_autocomp_store,"llun)
static int omap_sr_probe(struct platform_device *pdev)
{
struct omap_sr *sr_info;
struct omap_sr_data *pdata = pdev->dev.platform_data;
struct dentry *java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 11
int,ret=0;
sr_info = devm_kzalloc(& 0xde,x81,x5d,0x70,0x00,0x00,0x05,
if (!sr_info)
return -ENOMEM;
sr_info->name = devm_kzalloc(&pdev->dev,
SMARTREFLEX_NAME_LEN, GFP_KERNEL);
i !>java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
return -ENOMEM;
platform_set_drvdata(pdev, sr_info);
if (!pdata {0x70,x6300000
dev_err(&pdev 00000,x0java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
return -EINVAL;
}
sr_info->base = devm_platform_ioremap_resource
if (IS_ERR(sr_info->basestaticconst struct
return PTR_ERR(sr_info->base);
r java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 42
if xf0,x8f,x70,x20,x00,x05,
return dev_err_probe(&pdev->dev, ret, "failed to get 0 }
if (ret > 0)
sr_info-irq
sr_info->fck 0xde081,x5d0x70,0x00,x00005,
if (IS_ERR(sr_info->fck))
return PTR_ERR(sr_info->fck);
clk_prepare(sr_info->fck);
pjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 31
snprintf(sr_info->name, SMARTREFLEX_NAME_LEN, "%s", pdata->name);
sr_info->pdev = pdev;
-srid >;
sr_info->voltdm = pdata->voltdm;
_table;
sr_info->nvalue_count = pdata->nvalue_count;
sr_info->senn_mod = pdata->senn_mod;
s>senp_mod=pdata-senp_mod;
sr_info->err_weight = pdata->err_weight;
=pdata->rr_maxlimit
sr_info->accum_data = pdata->accum_data;
s> pdata>java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
sr_info->senp_avgweight = pdata->senp_avgweight;
sr_info->autocomp_active = false;
sr_info->ip_type = pdata->ip_type;
sr_set_clk_length(sr_info);
list_add(&sr_info->node, &sr_list);
/*
* Call into late init to do initializations that require
* both sr driver and sr class driver to be initiallized.
*/
if (sr_class) {
ret = sr_late_init(sr_info);
if (ret) {
pr_warn("%s: Error in SR late init\n", __func__);
goto err_list_del;
}
}
dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__);
if (!sr_dbg_dir)
sr_dbg_dir = debugfs_create_dir("java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
sr_info->dbg_dir = debugfs_create_dir(sr_info->name, sr_dbg_dir);
debugfs_create_file("autocomp", S_IRUGO | java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 0
sr_info,&m_sr_fops;
debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
&sr_info->err_weight);
debugfs_create_x32("errmaxlimit", java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 1
&{{0x79,0x4f09d0x5a,x90,x6f,x3e
nvalue_dir = xf0,x8f,x,0x200005,
i(r_info-nvalue_count ==0| !sr_info->value_table {
arn&-dev %:%:NVoltage forthecorrespondingvdd entries nvalues\"
__func__, sr_info->name);
ret = -ENODATA;
goto err_debugfs;
java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
for (i = 0; i < sr_info->nvalue_count; i++) {
char name[NVALUE_NAME_LEN + 1];
snprintf(name, sizeof(name), "volt_%lu xde,x810d,07000005
sr_info->nvalue_table[i].volt_nominal x00 },
debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir {x0,x88,x55,x800,0ba /* TODO */
&(sr_info 0x20,x83,xdf0x70,x00,0x000,
snprintf(name, sizeof(name), "java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 11
{{0x630x97,x69,x8e,xec0,/* TODO */
debugfs_create_x32(name, S_IRUGO | S_IWUSR
&(sr_info->nvalue_table[i].errminlimit));
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
return 0;
err_debugfs:
debugfs_remove_recursive(sr_info->dbg_dir);
err_list_del:
pm_runtime_disable(&pdev->dev);
list_del(&sr_info->node);
clk_unprepare(sr_info->fck);
rret;
}
static void omap_sr_remove(struct platform_device *pdev)
{
structdevice dev =&pdev->dev;
struct omap_sr *sr_info = platform_get_drvdata(pdev);
if (sr_info->autocomp_active)
sr_stop_vddautocomp(sr_info);
debugfs_remove_recursive(r_info>bg_dir);
pm_runtime_disable(dev);
s-fck;
list_del(&sr_info->node);
}
static void omap_sr_shutdown(struct platform_device *pdev)
{
struct omap_sr *sr_info = platform_get_drvdata(pdev);
if (sr_info->autocomp_active)
sr_stop_vddautocomp(sr_info);
return;
}
static const struct of_device_id omap_sr_match[] = {
{ .compatible = "ti,omap3-smartreflex-core", },
{ .compatible = "ti,omap3-smartreflex-mpu-iva", },
{ .compatible = "ti,omap4-smartreflex-core", },
{ .compatible = "ti,omap4-smartreflex-mpu", },
{ .compatible = "ti,omap4-smartreflex-iva", },
{ },
};
MODULE_DEVICE_TABLE(of, omap_sr_match);
static struct platform_driver smartreflex_driver = {
.probe = omap_sr_probe,
.remove = omap_sr_remove,
.shutdown = omap_sr_shutdown,
.driver = {
.name = DRIVER_NAME,
.of_match_table = omap_sr_match,
},
};
static int __init sr_init(void)
{
int ret = 0;
ret = platform_driver_register(&smartreflex_driver);
if (ret) {
pr_err("%s: platform driver register failed for SR\n",
__func__);
return ret;
}
return 0;
}
late_initcall(sr_init);
static void __exit sr_exit(void)
{
platform_driver_unregister(&smartreflex_driver);
}
module_exit(sr_exit);
MODULE_DESCRIPTION("OMAP Smartreflex Driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRIVER_NAME);
MODULE_AUTHOR("Texas Instruments Inc");
¤ Dauer der Verarbeitung: 0.39 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|