Commit 93c03729 authored by Alex Elder's avatar Alex Elder Committed by David S. Miller

net: ipa: pass data for source and dest resource config

Pass the resource data pointer to ipa_resource_config_src() and
ipa_resource_config_dst() to be used for configuring resource
limits.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7336ce1a
...@@ -129,12 +129,15 @@ ipa_resource_config_common(struct ipa *ipa, u32 offset, ...@@ -129,12 +129,15 @@ ipa_resource_config_common(struct ipa *ipa, u32 offset,
} }
static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type, static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type,
const struct ipa_resource *resource) const struct ipa_resource_data *data)
{ {
u32 group_count = ipa_resource_group_src_count(ipa->version); u32 group_count = ipa_resource_group_src_count(ipa->version);
const struct ipa_resource_limits *ylimits; const struct ipa_resource_limits *ylimits;
const struct ipa_resource *resource;
u32 offset; u32 offset;
resource = &data->resource_src[resource_type];
offset = IPA_REG_SRC_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type); offset = IPA_REG_SRC_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type);
ylimits = group_count == 1 ? NULL : &resource->limits[1]; ylimits = group_count == 1 ? NULL : &resource->limits[1];
ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits); ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits);
...@@ -155,12 +158,15 @@ static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type, ...@@ -155,12 +158,15 @@ static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type,
} }
static void ipa_resource_config_dst(struct ipa *ipa, u32 resource_type, static void ipa_resource_config_dst(struct ipa *ipa, u32 resource_type,
const struct ipa_resource *resource) const struct ipa_resource_data *data)
{ {
u32 group_count = ipa_resource_group_dst_count(ipa->version); u32 group_count = ipa_resource_group_dst_count(ipa->version);
const struct ipa_resource_limits *ylimits; const struct ipa_resource_limits *ylimits;
const struct ipa_resource *resource;
u32 offset; u32 offset;
resource = &data->resource_dst[resource_type];
offset = IPA_REG_DST_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type); offset = IPA_REG_DST_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type);
ylimits = group_count == 1 ? NULL : &resource->limits[1]; ylimits = group_count == 1 ? NULL : &resource->limits[1];
ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits); ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits);
...@@ -189,10 +195,10 @@ int ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data) ...@@ -189,10 +195,10 @@ int ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data)
return -EINVAL; return -EINVAL;
for (i = 0; i < data->resource_src_count; i++) for (i = 0; i < data->resource_src_count; i++)
ipa_resource_config_src(ipa, i, &data->resource_src[i]); ipa_resource_config_src(ipa, i, data);
for (i = 0; i < data->resource_dst_count; i++) for (i = 0; i < data->resource_dst_count; i++)
ipa_resource_config_dst(ipa, i, &data->resource_dst[i]); ipa_resource_config_dst(ipa, i, data);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment