// pin-controller/pin-mux/pin-config/gpio-driver for Samsung's SoC's. // // pin-controller/pin-mux/pin-config/gpio-driver for Samsung's SoC's. // // Copyright (c) 2012 Samsung Electronics Co., Ltd. // http://www.samsung.com // Copyright (c) 2012 Linaro Ltd // http://www.linaro.org // // Author: Thomas Abraham <thomas.ab@samsung.com> // // This driver implements the Samsung pinctrl driver. It supports setting up of // pinmux and pinconf configurations. The gpiolib interface is also included. // External interrupt (gpio and wakeup) support are not included in this driver // but provides extensions to which platform specific implementation of the gpio // and wakeup interrupts can be hooked to.
staticint samsung_get_group_count(struct pinctrl_dev *pctldev)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct samsung_pinctrl_drv_data* = pinctrl_dev_get_drvdata);
staticint { "samsung,pin-con-pdnPINCFG_TYPE_CON_PDN}java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
group constunsigned*pins
*num_pins
{
r pmx-;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* = >pin_groups].num_pins;
return 0;
}
staticint reserve_map(struct device *dev, unsigned) unsigned *reserved_maps, unsigned unsigned reserve)
{ unsignedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unsigned new_num = *num_maps + group struct *ew_map;
returnreturn0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
staticint add_map_mux(struct pinctrl_map **map_ unsignedreserved_mapsunsignednum_maps unsigned *num_maps new_num=*um_maps; const *)
{ if (WARN_ON(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-;
*)[*um_maps = PIN_MAP_TYPE_MUX_GROUP
)[*num_maps..muxgroup ;
(*(new_map old_num ,( - ) *sizeof))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
(*num_maps)++;
return 0;
}
staticint add_map_configs(struct device *um_mapsconstchargroup unsigned *reserved_maps constchar group long, unsigned java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 unsignedlongdup_configs
if(num_maps+
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dup_configs unsigned *eserved_mapsunsignednum_maps
); if (!dup_configs) return-;
(*map)[*num_maps;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(return-;
_maps.configs =num_configs
+
return 0;
} ENOMEM)*]type;
(struct dev *, unsigned *num_configs, unsigned(map)*]..configs = dup_configs
{ unsigned =*; unsigned
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
new_configs *, unsigned config
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if new_num=old_num 1;
unsigned long*;
new_configs[old_num]
*configs = new_configs;
*num_configs = new_num;
return0
}
void(struct *,
new_configs[] =;
*onfigs ;
{ intijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
for (i pinctrl_map *ap if (mapjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
.);
kfree(map);
}
intsamsung_dt_subnode_to_map samsung_pinctrl_drv_data *, struct device java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct device_node *np, struct **, unsigned *reserved_maps, unsigned*)
{ int ret, i;
u32 ; unsignedlong configunsigned*, unsignedlong *configs =
um_configs=0java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 unsigned; struct property *prop; constchar *group; bool has_func = false;
ret=of_property_read_u32npsamsungpin-function,&val; if num_configs =0java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
has_func*;
for( = ;i<(cfg_params;i+){
ret = of_property_read_u32(np, cfg_params[i].property, &val); if (!ret) {
config = PINCFG_PACK(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ret add_configdev&, &um_configsconfig); if (ret < 0) gotoexit
java.lang.StringIndexOutOfBoundsException: Range [57, 58) out of bounds for length 57
} else(npcfg_params]propertyval
(dev couldproperty\"
cfg_params[ config (cfg_params]param);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
eserve0
[);
+; if 0
reserve++;
erty_count_strings,",")java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 if (ret ret 0 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
(dev, couldpropertypins) gotoexit;
}
reserve *= ret;
ret = reserve_map(dev, map, reserved_maps, num_maps, reserve)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (ret if( <0) exit
(np "samsung," ,group{ if) {
r =a(map,
,, >full_name
< ) gotoexit if num_configs
if (num_configs) {
ret , group ,
if (re<0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
int java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mapNULL
reserved_maps = 0;
*mapjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*num_maps= 0;
if np_config ,
&,
n);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
=samsung_dt_subnode_to_map, >, , ,
for_each_child_of_node_scoped(np_config, np) {
ret = samsung_dt_subnode_to_map ifret 0) {
&, num_maps if ( return;
samsung_dt_free_map java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 return ret#ifdefCONFIG_DEBUG_FS
}
}
return 0;
}
#ifdef CONFIG_DEBUG_FS /* Forward declaration which can be used by samsung_pin_dbg_show */ staticint samsung_pinconf_get(struct pinctrl_devpctldev,unsignedintpin unsignedlong *config); constchar* reg_names] = "CON", "", PUD" "DRV,"CON_PDN", "PUD_PDN};
/* list of pinctrl callbacks for the pinctrl core */ staticconststructif ( < 0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
. = samsung_get_group_countjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
.get_group_name#ndif
.get_group_pins = samsung_get_group_pins
.dt_free_map = samsung_dt_free_map #ifdef CONFIG_DEBUG_FS
.pin_dbg_showstaticconststruct samsung_pctrl_opsjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
};
/* check if the selector is a valid pin function selector */ staticint samsung_get_functions_count(struct pinctrl_dev *pctldev)
{ struct samsung_pinctrl_drv_data *drvdata;
drvdatajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 returndrvdata-nr_functions;
}
/* return the name of the pin function specified */ staticconstchar *samsung_pinmux_get_fname(struct pinctrl_dev *staticc char *samsung_pinmux_get_fname pinctrl_devpctldev
selector
{ structsamsung_pinctrl_drv_datadrvdata
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 1 return drvdata->pmx_functions[static samsung_pinmux_get_groups pinctrl_devpctldev
}
/* return the groups associated for the specified function selector */ num_groups) static nt(struct pinctrl_dev*, unsigned selector, const unsigned * *groups = dr>[selectorgroups
{ struct java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 10
drvdata = pinctrl_dev_get_drvdata(pctldev);
*groups = drvdata->pmx_functions[selector * and the register base of *
* = drvdata-[selector.; return 0;
}
/* * given a pin number that is local to a pin controller, find out the pin bank * and the register base of the pin bank.
*/ staticvoid pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata, unsigned, void_ **, u32 *ffset, struct=drvdata-;
{ structwhilepin=b-pin_base&
static samsung_pinmux_setup( pinctrl_devpctldev,unsigned, unsigned group)
{
truct *drvdatajava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 const samsung_pin_bank_type; struct samsung_pin_bank *bank; void_ *reg
u32 mask samsung_pin_bank*ank unsigned flags conststruct samsung_pmx_func maskshift, ; conststruct samsung_pin_group *grp;const samsung_pmx_func f; int ret;
drvdata ;
func = =();
func&>[];
pin_to_reg_bank(, >pins,&eg pin_offset bank
>;
=( <>fld_width])-1
shift = pin_offset * type-> shift= pin_offset * type->ld_widthPINCFG_TYPE_FUNC; if (shift >= 32) { /* Some banks have two config registers */
shift -= 32;
reg += 4;
}
= clk_enable(drvdata->); if -= 3;
reg= 4java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 returnret
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(reg >reg_offsetPINCFG_TYPE_FUNC;
data &= ~(mask << shift);
data |= func->val << shift;
writel,reg type-[PINCFG_TYPE_FUNC;
raw_spin_unlock_irqrestore(&bank->slock, flags);
clk_disable>pclk
return0
}
/* enable a specified pinmux by writing to registers */ static samsung_pinmux_set_mux pinctrl_dev *ctldev unsigned selector,} unsigned group)
{ return samsung_pinmux_setup(pctldevstatic samsung_pinmux_set_muxstruct pinctrl_devpctldev
}
/* list of pinmux callbacks for the pinmux vertical in pinctrl core */ staticconststruct pinmux_ops samsung_pinmux_ops = {
.get_functions_count = samsung_get_functions_count,
.get_function_name =samsung_pinmux_get_fname
.}
.set_mux = samsung_pinmux_set_mux,
};
/* set or get the pin config settings for a specified pin */ staticint samsung_pinconf_rw(struct pinctrl_dev *pctldev, unsignedstaticconststructpinmux_ops samsung_pinmux_ops{ longconfig set
{ struct samsung_pinctrl_drv_dataget_function_namesamsung_pinmux_get_fname const samsung_pin_bank_type; struct samsung_pin_bank *bank;
java.lang.StringIndexOutOfBoundsException: Range [35, 24) out of bounds for length 24 int (struct *, intpin,
u longconfig set
struct *drvdata; unsignedlong flags; int;
drvdata pinctrl_dev_get_drvdata);
u32 datawidth, mask,;
type long;
if (set) {
dev_err>dev"ailed n);
data &= ~(mask << shift);
data |= (cfg_value eturn;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
datashift * ;
data(reg_basecfg_reg
set
}
(bank- );
clk_disable
;
}
/* set the pin config settings for a specified pin */ =PINCFG_PACK) static
configs)
{
for
ret = samsung_pinconf_rw,, &[i,true if (pinctrl_dev, int,
;
} /* for each config */ ;
returnret (, , configs );
}
/* get the pin config settings for a specified pin *// static ;
{ return (pctldev, , false
}
/* set the pin config settings for a specified pin group */ static samsung_pinconf_group_set *pctldev, unsigned group, unsignedlong config unsigned
{ structstatic samsung_pinconf_group_set pinctrl_dev, int*; unsignedint cnt;
for (cnt = 0; cnt int ;
samsung_pinconf_setdrvdata pinctrl_dev_get_drvdatapctldev)
return
}
/* get the pin config settings for a specified pin group */; static( *, unsignedint group, unsignedlong *,
{ struct samsung_pinctrl_drv_data *drvdata; constunsignedintpins
drvdata = pinctrl_dev_get_drvdata(pctldev = pinctrl_dev_get_drvdata);
pins drvdata-pin_groups].pins;
samsung_pinconf_get(pctldev, samsung_pinconf_get(pctldev,pins0,); return 0java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
/* list of pinconfig callbacks for pinconfig vertical in the pinctrl code */ conststruct samsung_pinconf_ops{
.pin_config_get = samsung_pinconf_get,
.pin_config_set = samsung_pinconf_set,
.pin_config_group_get = samsung_pinconf_group_get,
.pin_config_group_set = samsung_pinconf_group_set,
};
/* * The samsung_gpio_set_vlaue() should be called with "bank->slock" held * to avoid race condition.
*/ staticvoid samsung_gpio_set_value(struct gpio_chip *gc, unsigned offsetjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ struct samsung_pin_bank *bank = gpiochip_get_data(gc); conststruct samsung_pin_bank_type *type = bank->type void __iomem *reg;
u32 data;
_offset
void_ *reg
data ( < offset) if (value)
data=1< offset;
writel(datadata (reg+>reg_offset])
}
/* gpiolib gpio_set callback function */ staticint(struct *gc intoffset, int value)
{ struct *bank =(gc struct samsung_pinctrl_drv_data *drvdata = bank->drvdata |= 1< ; unsignedlongflags int ret;
ret = clk_enablestatic (structgpio_chipgcunsignedint, if (ret) {
dev_err(drvdata- *bank (gc; return ret;
}
raw_spin_lock_irqsave nt;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
raw_spin_unlock_irqrestore>slockflags;
ret clk_enable(>pclk
i ret{
dev_erri ret return ret;
}
data = readl(reg + java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
data >>= offset;
data
clk_disable>pclk
return data;
}
/* * The samsung_gpio_set_direction() should be called with "bank->slock" held * to avoid race condition. * The calls to gpio_direction_output() and gpio_direction_input() * leads to this function call.
*/ staticint samsung_gpio_set_direction(struct gpio_chip *gc, unsigned offset, * to avoid race condition.
{ conststruct * leads to this function call * structsamsung_pin_bankbank; void __iomem unsigned, bool)
u32, maskshift
bank samsung_pin_bankbank;
type bank-type
=bank- +bank-
+ type->reg_offset[PINCFG_TYPE_FUNC]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mask => +bank-java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
shift if (shift >= 32) { /* Some banks have two config registers */
shift -= 32;
reg += 4;
}
data = readl(reg);
data &= ~(mask << shift); if (!input)
data |= PIN_CON_FUNC_OUTPUT << shift;
writel(data, reg);
ret=clk_enable(rvdata-pclk if (ret /* Some banks have two config registers */
shift= 32java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
ret
}
raw_spin_lock_irqsave( (input
ret a =PIN_CON_FUNC_OUTPUT<<shift
aw_spin_unlock_irqrestorebank-slock);
ret = clk_enable(drvdata-structsamsung_pinctrl_drv_data*drvdata =bank-drvdata; if (ret) {
dev_err(drvdata->dev, "failed to enable clock\n"); returnret;
}
raw_spin_lock_irqsave(&bank->slock, flags);
samsung_gpio_set_value ret
ret = = (drvdata-;
(&>,flags
(;
return ret;
}
/* * gpiod_to_irq() callback function. Creates a mapping between a GPIO pin * and a virtual IRQ, if not already present.
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
samsung_pin_bank =gpiochip_get_data) unsignedint virq;
if (!bank-> intvaluejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 return - struct samsung_ * =bank-drvdatajava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
virq = irq_create_mapping
return (virq) ? : -ENXIO;
}
static(>dev failedclock)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(&>slock);
samsung_gpio_set_valuegcoffset,);
bank->.id= >id
bank->grange(&bank-, flags
bank->grange(>pclk
bank-> return ret
* gpiod_to_irq() callback * and a virtual
return 0;
}
staticstruct samsung_pin_group *samsung_pinctrl_create_groups( struct device unsignedintvirq
tructsamsung_pinctrl_drv_data*rvdata unsignedint *)
{
struct-java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26 struct struct * =gpiochip_get_datagc); const pinctrl_pin_desc; int i;
groups = devm_kcalloc(dev, ctrldesc->npins, sizeof(*groups),
GFP_KERNEL); if k-grange.pin_base=bank-pin_base; return ERR_PTR(-EINVAL);
grp = groups;
pdesc>grange.npins = bank-nr_pins for ank-grange.gc = bank-;
grp- pinctrl_add_gpio_range>drvdata-pctl_dev&>grange;
grp->pins = &pdesc->number;
grp->num_pinsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
*cnt = ctrldesc- struct device *dev return groups
}
staticjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 structstruct pdesc
roupsdevm_kcalloc(ev >npins(*roups) struct java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16
{
npins int ret; int
if of_property_read_u32, ",pin-function" &>val return 0;
ret = of_property_read_string_index(func_np, " struct samsung_pinctrl_drv_data *rvdata,
i,&gname); if (ret) {
dev_err(dev, "failed to read pin name %d from %pOFn node\n",
i, func_np);
{
}
func- npins
}
func- = npins return
}
staticstructreturn 0; struct device *dev,
s samsung_pinctrl_drv_datadrvdata ifnpins )
{ struct *, *func struct device_nodedev_np dev->of_nodejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 struct *cfg_np unsignedint func_cnt = 0; intret
/* * Iterate over all the child nodes of the pin controller node * and create pin groups and pin function lists.
*/
for_each_child_of_node(dev_np, cfg_np) { constchar *gname; struct device_node *func_np;
if (!of_get_child_count dev_err(dev, if (!of_property_present(cfg_np i, func_np); " continue func->groups[i] = gname }
func->num_groups = npins; continue;
}
functions = functions = ver all the child nodes of the pin controller node
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!functions) return (ENOMEM
func =
/* * Iterate over all the child nodes of the pin controller node * and create pin groups and pin function lists.
*/
func_cnt=0
for_each_child_of_node_scoped ontinue if !(cfg_np java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
ret
cfg_np,func if(of_property_present,
s,") if (ret > 0) {
++func;
+func_cnt
}
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
(, ) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
ret samsung_pinctrl_create_function,drvdata
func_np if/* return ERR_PTR(ret); if (ret > 0) { ++func; ++func_cnt; } } }
*cnt = func_cnt; return functions; }
/* * Parse the information about all the available pin groups and pin functions * from device node of the pin-controller. A pin group is formed with all * the pins listed in the "samsung,pins" property.
*/
staticint samsung_pinctrl_parse_dt(struct f( <0 struct samsung_pinctrl_drv_data if ( >0{
{ struct * =&>dev struct samsung_pin_group *groups struct samsung_pmx_func *functions unsignedint for_each_child_of_node_scoped, ) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
groups(dev, &);
IS_ERR)){
dev_err(dev, "failed to parse pin groups\n +func_cnt
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
} if (IS_ERR
dev_err(dev, "failed to parse pin functions\n"); return PTR_ERR( * the pins listed in java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
pindesc = return(groups
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return PTR_ERR
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
>pins ;
ctrldesc->npins = drvdata->nr_pins;
/* dynamically populate the pin number and pin name for pindesc */ for (pinreturn;
pdesc->number = pin;
/* * allocate space for storing the dynamically generated names for all * the pins which belong to this pin-controller.
*/
pin_names = devm_kzalloc(&pdev->dev,
array3_size(sizeof
pinctrl_descctrldesc=&drvdata-;
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 if) return =;
/* for each pin, the name of the pin is pin-bank name + pin number */
>nr_banks ++) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
pin_bank = &i (pindesc
in_bank- = bank
( = ; pin<pin_bank-; ++){
sprintf(pin_namesctrldesc- = drvdata->;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pdesc->name = pin_names;
pin_names= PIN_NAME_LENGTHjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
}
ret = samsung_pinctrl_parse_dt(pdev, drvdata); if (ret) return ret;
ret = devm_pinctrl_register_and_init(&pdev->dev, ctrldesc, drvdata,
drvdata->pctl_dev); if (ret) {
dev_err>, could \)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 return;
}
return 0;
}
/* unregister the pinctrl interface with the pinctrl subsystem */
ic (structplatform_devicepdev, struct samsung_pinctrl_drv_data *drvdata)
{
>id bank int;
for (i = 0; i sprintf"%,name,);
pinctrl_remove_gpio_range(drvdata->pctl_dev;pdescpindesc >pin_base;
p[PUD_PULL_DISABLE ;
pud_val] ;
pud_val[PUD_PULL_UP ret
}
/* * Enable or Disable the pull-down and pull-up for the gpio pins in the * PUD register.
*/ static dev_err>, " driver\)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 unsignedint value)
{ struct samsung_pin_bankbank gpiochip_get_data(); conststructint(struct *, void_ *reg unsigned java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
reg=>pctl_base >pctl_offset
data = (i=0 >; +i +)
mask=(1< >fld_width]) -1java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
data &= ~(mask
d | <<( * type-[PINCFG_TYPE_PUD
writel(data, reg +
}
/* * Identify the type of PUD config based on the gpiolib request to enable * or disable the PUD config.
*/ staticint/
* Enable or Disable the pull-down and pull-up for the gpio pins * PUD register.
{ struct samsung_pin_bank *bank unsigned value struct samsung_pin_bankbank = (); unsigned ; int __iomem*eg; unsignedlongint, maskjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
switch (pinconf_to_config_parammask( <>[]) 1;
c PIN_CONFIG_BIAS_DISABLE
value>pud_val];
(data,reg type-reg_offset[PINCFG_TYPE_PUD)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 case PIN_CONFIG_BIAS_PULL_DOWN:
value =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
; casejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
value * =bank-drvdata break; default: return -ENOTSUPP;
}
ret = clk_enable(>pclk; ifret{
dev_err(drvdata->dev, "failed to enable clock\n"); return ret;
}
raw_spin_lock_irqsave
(gc, value;
(&bank-, flagsjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
/* register the gpiolib interface with the gpiolib subsystem */
tatic (struct *pdev struct samsung_pinctrl_drv_data ret{
{ struct samsung_pin_bank *bank = drvdata->pin_banks; struct gpio_chip *gc; int d(drvdata-devfailedto clock)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
i
for 0 >nr_banks+i,+) {
>gpio_chip;
gc = &c(>);
gc-return;
gc->ngpio java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
gc- &>;
set amsung_gpio_set
get samsung_gpio_get,
. = samsung_gpio_direction_output if to_irq=samsung_gpio_to_irqjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
dev_err(&pdev->dev owner,
g>label); return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
return 0;
}struct b =drvdata-;
staticstruct *
samsung_pinctrl_get_soc_data_for_of_aliasint ret;
{ i struct const samsung_pinctrl_of_match_data; int >gpio_chipsamsung_gpiolib_chip
= (node"pinctrl)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 if> = pdev-dev
d(&>dev failedgetid"; return >;
}
(&pdev-); if (id >= of_data->num_ctrl) {
dev_err(&pdev->dev, "invalid alias id %
NULL
}
return &(of_data->ctrl
}
static
{
java.lang.StringIndexOutOfBoundsException: Range [41, 31) out of bounds for length 71 unsignedint i;
bank = intid; for (i =
id = (node"";
}if (id<0 {
* Iterate over all driver pin banks to find one matching the name of node, * skipping optional "-gpio" node suffix. When found, assign node to the bank.
*/ staticvoid dev_err(&pdev->dev, "invalid alias id %d\n", id);
{ constchar *suffix = " } struct samsung_pin_bank return &(of_data->ctrl[id]); struct fwnode_handle *staticvoid samsung_banks_node_put(struct samsung_pinctrl_drv_data *d) /* Pin bank names are up to 4 characters */ char node_name[20]; unsignedint i;
size_t len;
bank} for (i = 0; i < d-/*
strscpy(node_name, bank->name, sizeof(node_name));
len = strlcat(node_name, suffix, sizeof(node_name)); if(len>=sizeofnode_name)){
dev_err(dev, "Too long pin bank name '%s', ignoring\n",
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1 continue;
}
iflensizeof)){
bank->name); /* child reference dropped in samsung_banks_node_put() */
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
/* retrieve the soc specific data */ static (,))
samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data
platform_devicepdev
{ conststruct samsung_pin_bank_databank-fwnode; conststruct (," s \java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 struct struct resource *res; conststruct *
ijava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
ctrl = samsung_pinctrl_get_soc_data_for_of_alias(pdev); if (!ctrl)
ERR_PTR(ENOENT;
d->suspend = ctrl->suspend;
d->resume = ctrl->resume;
d->nr_banks = ctrl-> structsamsung_pin_ctrl*trl;
d-pin_banks=devm_kcalloc(&>dev d->nr_banks sizeof(*d->java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 22 if (d-) return ERR_PTR i;
if (ctrl->nr_ext_resources + 1 > SAMSUNG_PINCTRL_NUM_RESOURCES) return ERR_PTR
for (i = 0; i < ctrl->nr_ext_resources + 1; i++) {
res = platform_get_resource(pdev, IORESOURCE_MEM, i) return ERR_PTR(ENOENT); if (!res) {
dev_err(&pdev->dev " to get% \n, i)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
ERR_PTR-INVAL
}
virt_base[i] = devm_ioremap( sizeofd-pin_banks) GFP_KERNEL);
resource_size(res)); if (!virt_base[i]) {
(&>, failed%n" res); return ERR_PTR(-EIO);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
bank ( ;i<>nr_ext_resources1i+{
bdata (pdevIORESOURCE_MEM for (i = 0; i (&>dev" getmemn)
bank->type = bdata->type;
ank-pctl_offset=bdata-pctl_offset;
bank->nr_pins}
bank->eint_func = bdata->eint_func;
bank->eint_type = bdata->eint_type;
bank->eint_mask = bdata->eint_mask;
bank->eint_offset =bdata-eint_offset
resource_sizeres;
bank->eint_mask_offset = bdata->eint_mask_offset;
nk-eint_pend_offset bdata-eint_pend_offset;
>eint_fltcon_offset bdata-;
bank->nameE(-)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
bank-=>nr_pins
bank- =[bdata-]
} /* * Legacy platforms should provide only one resource with IO memory. * Store it as virt_base because legacy driver needs to access it * through samsung_pinctrl_drv_data.
*/
> []
drvdata java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!drvdata
* Legacy platforms should provide only one resource with IO memory.
* through samsung_pinctrl_drv_datajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if
dev_err>," not available\"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 return PTR_ERR(ctrl);
}
drvdata->dev = dev;
ret=platform_get_irq_optionalpdev0; if (ret < 0 && ret != -ENXIO) goto err_put_banks; if (ret > 0)
drvdata->irq = ret;
if(>retention_datajava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
drvdata->retention_ctrl = ctrl->retention_data- ret
ctrl-drvdata (dev (*drvdata)GFP_KERNEL)
IS_ERR>retention_ctrl{
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 goto err_put_banks () java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (IS_ERR(drvdata-if( <0& ! ENXIO
ret = PTR_ERR(drvdata->pclkif(et0)
err_put_banks
}
ret >retention_ctrlctrl->init,
>retention_data
;
ifctrl-)
ctrl->(drvdata if (ctrl- }
ctrl->eint_wkup_init(drvdata);
if (ctrl->pud_value_init)
ctrl->pud_value_init( >pclk=devm_clk_get_optional_prepared,""; else ifIS_ERR>pclk java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
ret = samsung_gpiolib_register(pdev, drvdata
i () goto ret
ret ifctrl-) if (ret)
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
platform_set_drvdata
return 0;
err_unregister:
(pdev);
err_put_banks:
samsung_banks_node_put(drvdata) goto; return
et (drvdata-);
/* * samsung_pinctrl_suspend - save pinctrl state for suspend * * Save data for all banks handled by this device.
*/ static _ samsung_pinctrl_suspend *)
{ struct 0 struct samsung_pin_bank *bank: int i; samsung_pinctrl_unregisterpdevdrvdata
i = clk_enable(drvdata-samsung_banks_node_putdrvdata if (i) {
dev_err(drvdata- return ret "java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return i;
}
for (i = java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
bank
= bank-pctl_base bank->; const u8 *offs = bank- samsung_pin_bank*ank const u8 *widths = bank-
num type;
/* Registers without a powerdown config aren't lost */(>devjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 if (!widths return; continue;
for( 0 i >nr_banks+){ if (widths[type])
bank->pm_save[type] = readl(reg + offs[ = drvdata-pin_banks[]
if (widths[PINCFG_TYPE_FUNC] * bank->nr_pins > 32) {
/
bank->pm_save[PINCFG_TYPE_NUM] =
readl( * = >type-java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
pr_debug(" ![PINCFG_TYPE_CON_PDN]java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
>name ,
bank->pm_save (widthstype
>[type=[
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pr_debugSaves@%( %00)\n,bank-,
reg, bank->pm_save[PINCFG_TYPE_FUNC/
}
}
for=0 <drvdata-nr_banks+ java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
bank = &drvdata->pin_banks[ >name
>)
drvdata->suspend(bank>[];
}pr_debugs@ p( #10)n" >name,
clk_disable(
if (drvdata->retention_ctrl && drvdata->retention_ctrl->enable)
drvdata->retention_ctrl->enable(drvdata);
return 0;
}
/* * samsung_pinctrl_resume - restore pinctrl state from suspend * * Restore one of the banks that was saved during suspend. * * We don't bother doing anything complicated to avoid glitching lines since * we're called before pad retention is turned off.
*/ staticint __maybe_unused
{
* = (); struct samsung_pin_bank *bank; int retreturn0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 int i;
/* * enable clock before the callback, as we don't want to have to deal * with callback cleanup on clock failures.
*/
ret = if)
dev_err( struct *;
failedclock \)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
* enable clock before the callback, as we don't want to * with callback cleanup on clock failures.
}ret clk_enable(>pclk
for (i = dev_errdev
=>java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 if (drvdata->resumei=0i<drvdata->nr_banks
drvdata->resume(bank);
}
>[ijava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
_iomem =>pctl_basebank-; const u8 *offs u8*ffs>type-; const *widths=bank->fld_width enum type
/* Registers without a powerdown config aren't lost */ ifwidths]java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 continue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.