2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 09:43:59 +08:00

Pin control fixes for v5.3:

- A single patch for some Aspeed problems. The BMCs are much
   happier now.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAl16AN0ACgkQQRCzN7AZ
 XXN5EA/+LSMeYpoLPEi2NbEikj00hl71zyLRCb4X2KZKqqc6Wa7gbp0tTNLAmfX/
 zCPiSF0bsUlKjRrwHsMsPwq9mju4vbgsUILwddEy++CXZQeVRs8eOTuWF8a9a2Ga
 1D3ZLrQHwBl7CiboWnnXsPW7vPvOq+nV4hVMCrernYpYk5FM4SqDs+pqMtpZZP5J
 LW83RhBpjatdoqsQ2ZvUlOOADYALXtbCh9gCCZ9q5DejYTMMkr0EpyUMyC2quDYV
 RB9qpISkprwApjjnLSRe38KoErtrHTyr8mP96Y9b7pR8lQc/4mc+L5NGtiL0Xnk0
 /oC6eolIrDJQvV2lZjAXmfV6KVTS2c6ts9Vpusc8iQfaqnfsQC53/W8XcqpjKfmY
 NpK9rL41veoVWJmnm2wrvRcCpqFrVhqHb875ZhksdbAaXbLVoXo4Mwi8SY7GSAEv
 V4WVcevNqgEk7ip3RAPAMSx36bnx9aFXEWRXRThbh77yuBcsKM7taQIp9KtQPPtQ
 /ZR37N0pFxmOPdaSqX9tjsXw9QWKqy+FPmDlKfR4mh1JCzav5YszgOc5S1NDAsqK
 E3nyLrubyTZiGwpzqtF3sOVVoW9DccRQEpxE3YnwkCSA0OdaOCMpC0b7zlftYQpK
 CDjzgEgUpN1wgu6a1xAkkaVKc7FalmuLYkG4XbIgd0NjsBNfzr4=
 =JzRC
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fix from Linus Walleij:
 "Hopefully last pin control fix: a single patch for some Aspeed
  problems. The BMCs are much happier now"

* tag 'pinctrl-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: aspeed: Fix spurious mux failures on the AST2500
This commit is contained in:
Linus Torvalds 2019-09-12 10:58:47 +01:00
commit 840ce8f807
3 changed files with 38 additions and 6 deletions

View File

@ -2552,7 +2552,7 @@ static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx,
if (IS_ERR(map))
return map;
} else
map = ERR_PTR(-ENODEV);
return ERR_PTR(-ENODEV);
ctx->maps[ASPEED_IP_LPC] = map;
dev_dbg(ctx->dev, "Acquired LPC regmap");
@ -2562,6 +2562,33 @@ static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx,
return ERR_PTR(-EINVAL);
}
static int aspeed_g5_sig_expr_eval(struct aspeed_pinmux_data *ctx,
const struct aspeed_sig_expr *expr,
bool enabled)
{
int ret;
int i;
for (i = 0; i < expr->ndescs; i++) {
const struct aspeed_sig_desc *desc = &expr->descs[i];
struct regmap *map;
map = aspeed_g5_acquire_regmap(ctx, desc->ip);
if (IS_ERR(map)) {
dev_err(ctx->dev,
"Failed to acquire regmap for IP block %d\n",
desc->ip);
return PTR_ERR(map);
}
ret = aspeed_sig_desc_eval(desc, enabled, ctx->maps[desc->ip]);
if (ret <= 0)
return ret;
}
return 1;
}
/**
* Configure a pin's signal by applying an expression's descriptor state for
* all descriptors in the expression.
@ -2647,6 +2674,7 @@ static int aspeed_g5_sig_expr_set(struct aspeed_pinmux_data *ctx,
}
static const struct aspeed_pinmux_ops aspeed_g5_ops = {
.eval = aspeed_g5_sig_expr_eval,
.set = aspeed_g5_sig_expr_set,
};

View File

@ -78,11 +78,14 @@ int aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc,
* neither the enabled nor disabled state. Thus we must explicitly test for
* either condition as required.
*/
int aspeed_sig_expr_eval(const struct aspeed_pinmux_data *ctx,
int aspeed_sig_expr_eval(struct aspeed_pinmux_data *ctx,
const struct aspeed_sig_expr *expr, bool enabled)
{
int i;
int ret;
int i;
if (ctx->ops->eval)
return ctx->ops->eval(ctx, expr, enabled);
for (i = 0; i < expr->ndescs; i++) {
const struct aspeed_sig_desc *desc = &expr->descs[i];

View File

@ -702,6 +702,8 @@ struct aspeed_pin_function {
struct aspeed_pinmux_data;
struct aspeed_pinmux_ops {
int (*eval)(struct aspeed_pinmux_data *ctx,
const struct aspeed_sig_expr *expr, bool enabled);
int (*set)(struct aspeed_pinmux_data *ctx,
const struct aspeed_sig_expr *expr, bool enabled);
};
@ -722,9 +724,8 @@ struct aspeed_pinmux_data {
int aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc, bool enabled,
struct regmap *map);
int aspeed_sig_expr_eval(const struct aspeed_pinmux_data *ctx,
const struct aspeed_sig_expr *expr,
bool enabled);
int aspeed_sig_expr_eval(struct aspeed_pinmux_data *ctx,
const struct aspeed_sig_expr *expr, bool enabled);
static inline int aspeed_sig_expr_set(struct aspeed_pinmux_data *ctx,
const struct aspeed_sig_expr *expr,