Lines Matching +full:imx6q +full:- +full:snvs +full:- +full:lpgpr

1 // SPDX-License-Identifier: GPL-2.0-only
9 #include <linux/nvmem-provider.h>
57 const struct snvs_lpgpr_cfg *dcfg = priv->dcfg; in snvs_lpgpr_write()
61 ret = regmap_read(priv->regmap, dcfg->offset_hplr, &lock_reg); in snvs_lpgpr_write()
66 return -EPERM; in snvs_lpgpr_write()
68 ret = regmap_read(priv->regmap, dcfg->offset_lplr, &lock_reg); in snvs_lpgpr_write()
73 return -EPERM; in snvs_lpgpr_write()
75 return regmap_bulk_write(priv->regmap, dcfg->offset + offset, val, in snvs_lpgpr_write()
83 const struct snvs_lpgpr_cfg *dcfg = priv->dcfg; in snvs_lpgpr_read()
85 return regmap_bulk_read(priv->regmap, dcfg->offset + offset, in snvs_lpgpr_read()
91 struct device *dev = &pdev->dev; in snvs_lpgpr_probe()
92 struct device_node *node = dev->of_node; in snvs_lpgpr_probe()
100 return -ENOENT; in snvs_lpgpr_probe()
104 return -ENOMEM; in snvs_lpgpr_probe()
108 return -EINVAL; in snvs_lpgpr_probe()
112 return -ENODEV; in snvs_lpgpr_probe()
114 priv->regmap = syscon_node_to_regmap(syscon_node); in snvs_lpgpr_probe()
116 if (IS_ERR(priv->regmap)) in snvs_lpgpr_probe()
117 return PTR_ERR(priv->regmap); in snvs_lpgpr_probe()
119 priv->dcfg = dcfg; in snvs_lpgpr_probe()
121 cfg = &priv->cfg; in snvs_lpgpr_probe()
122 cfg->priv = priv; in snvs_lpgpr_probe()
123 cfg->name = dev_name(dev); in snvs_lpgpr_probe()
124 cfg->dev = dev; in snvs_lpgpr_probe()
125 cfg->stride = 4; in snvs_lpgpr_probe()
126 cfg->word_size = 4; in snvs_lpgpr_probe()
127 cfg->size = dcfg->size; in snvs_lpgpr_probe()
128 cfg->owner = THIS_MODULE; in snvs_lpgpr_probe()
129 cfg->reg_read = snvs_lpgpr_read; in snvs_lpgpr_probe()
130 cfg->reg_write = snvs_lpgpr_write; in snvs_lpgpr_probe()
138 { .compatible = "fsl,imx6q-snvs-lpgpr", .data = &snvs_lpgpr_cfg_imx6q },
139 { .compatible = "fsl,imx6ul-snvs-lpgpr",
141 { .compatible = "fsl,imx7d-snvs-lpgpr", .data = &snvs_lpgpr_cfg_imx7d },
156 MODULE_DESCRIPTION("Low Power General Purpose Register in i.MX6 and i.MX7 Secure Non-Volatile Stora…