Lines Matching refs:comm
47 #define GPI_SMI_STS_OFFSET(comm, group) ((comm)->gpi_smi_sts_reg_0 + \ argument
49 #define GPI_SMI_EN_OFFSET(comm, group) ((comm)->gpi_smi_en_reg_0 + \ argument
51 #define GPI_IS_OFFSET(comm, group) ((comm)->gpi_int_sts_reg_0 + \ argument
53 #define GPI_IE_OFFSET(comm, group) ((comm)->gpi_int_en_reg_0 + \ argument
65 static size_t relative_pad_in_comm(const struct pad_community *comm, in relative_pad_in_comm() argument
68 return gpio - comm->first_pad; in relative_pad_in_comm()
81 static int pinctrl_group_index(const struct pad_community *comm, in pinctrl_group_index() argument
86 if (!comm->groups) in pinctrl_group_index()
90 for (i = 0; i < comm->num_groups; i++) { in pinctrl_group_index()
91 if (relative_pad >= comm->groups[i].first_pad && in pinctrl_group_index()
92 relative_pad < comm->groups[i].first_pad + in pinctrl_group_index()
93 comm->groups[i].size) in pinctrl_group_index()
100 static int pinctrl_group_index_scaled(const struct pad_community *comm, in pinctrl_group_index_scaled() argument
105 ret = pinctrl_group_index(comm, relative_pad); in pinctrl_group_index_scaled()
112 static int pinctrl_within_group(const struct pad_community *comm, in pinctrl_within_group() argument
117 ret = pinctrl_group_index(comm, relative_pad); in pinctrl_within_group()
121 return relative_pad - comm->groups[ret].first_pad; in pinctrl_within_group()
124 static u32 pinctrl_bitmask_within_group(const struct pad_community *comm, in pinctrl_bitmask_within_group() argument
127 return 1U << pinctrl_within_group(comm, relative_pad); in pinctrl_bitmask_within_group()
150 const struct pad_community *comm = priv->comm; in pinctrl_get_device() local
152 if (pad >= comm->first_pad && pad <= comm->last_pad) { in pinctrl_get_device()
164 const struct pad_community *comm; in intel_pinctrl_get_pad() local
173 comm = priv->comm; in intel_pinctrl_get_pad()
175 *offsetp = relative_pad_in_comm(comm, pad); in intel_pinctrl_get_pad()
182 const struct pad_community *comm) in pinctrl_configure_owner() argument
189 pin = relative_pad_in_comm(comm, cfg->pad); in pinctrl_configure_owner()
195 hostsw_own_offset = comm->host_own_reg_0; in pinctrl_configure_owner()
196 ret = pinctrl_group_index_scaled(comm, pin, sizeof(u32)); in pinctrl_configure_owner()
209 hostsw_own |= pinctrl_bitmask_within_group(comm, pin); in pinctrl_configure_owner()
211 hostsw_own &= ~pinctrl_bitmask_within_group(comm, pin); in pinctrl_configure_owner()
219 const struct pad_community *comm) in gpi_enable_smi() argument
231 pin = relative_pad_in_comm(comm, cfg->pad); in gpi_enable_smi()
232 ret = pinctrl_group_index(comm, pin); in gpi_enable_smi()
237 sts_reg = GPI_SMI_STS_OFFSET(comm, group); in gpi_enable_smi()
243 en_reg = GPI_SMI_EN_OFFSET(comm, group); in gpi_enable_smi()
244 pcr_setbits32(dev, en_reg, pinctrl_bitmask_within_group(comm, pin)); in gpi_enable_smi()
292 const struct pad_community *comm = priv->comm; in pad_config_offset() local
295 offset = relative_pad_in_comm(comm, pad); in pad_config_offset()
298 return offset + comm->pad_cfg_base; in pad_config_offset()
301 static int pinctrl_pad_reset_config_override(const struct pad_community *comm, in pinctrl_pad_reset_config_override() argument
304 const struct reset_mapping *rst_map = comm->reset_map; in pinctrl_pad_reset_config_override()
308 if (!rst_map || !comm->num_reset_vals) in pinctrl_pad_reset_config_override()
311 for (i = 0; i < comm->num_reset_vals; i++, rst_map++) { in pinctrl_pad_reset_config_override()
355 const struct pad_community *comm = priv->comm; in pinctrl_configure_pad() local
361 if (IS_ERR(comm)) in pinctrl_configure_pad()
362 return PTR_ERR(comm); in pinctrl_configure_pad()
369 ret = pinctrl_pad_reset_config_override(comm, in pinctrl_configure_pad()
379 comm->port, relative_pad_in_comm(comm, cfg->pad), i, in pinctrl_configure_pad()
390 ret = pinctrl_configure_owner(dev, cfg, comm); in pinctrl_configure_pad()
393 ret = gpi_enable_smi(dev, cfg, comm); in pinctrl_configure_pad()
403 const struct pad_community *comm = priv->comm; in intel_pinctrl_get_config_reg_offset() local
407 config_offset = comm->pad_cfg_base + offset * in intel_pinctrl_get_config_reg_offset()
430 const struct pad_community *comm = priv->comm; in intel_pinctrl_get_acpi_pin() local
435 group = pinctrl_group_index(comm, offset); in intel_pinctrl_get_acpi_pin()
438 if (comm->groups[group].acpi_pad_base == PAD_BASE_NONE) in intel_pinctrl_get_acpi_pin()
439 return comm->first_pad + offset; in intel_pinctrl_get_acpi_pin()
445 return comm->groups[group].acpi_pad_base + in intel_pinctrl_get_acpi_pin()
446 pinctrl_within_group(comm, offset); in intel_pinctrl_get_acpi_pin()
507 const struct pad_community *comm = priv->comm; in pinctrl_gpi_clear_int_cfg() local
511 for (group = 0; group < comm->num_gpi_regs; group++) { in pinctrl_gpi_clear_int_cfg()
513 pcr_write32(dev, GPI_IE_OFFSET(comm, group), 0); in pinctrl_gpi_clear_int_cfg()
517 GPI_IS_OFFSET(comm, group)); in pinctrl_gpi_clear_int_cfg()
518 pcr_write32(dev, GPI_IS_OFFSET(comm, group), sts_value); in pinctrl_gpi_clear_int_cfg()
620 const struct pad_community *comm, int num_cfgs) in intel_pinctrl_of_to_plat() argument
625 if (!comm) { in intel_pinctrl_of_to_plat()
631 priv->comm = comm; in intel_pinctrl_of_to_plat()