"rst_m31dphy_hw", "rst_m31dphy_b09_always_on",
"rst_isp_top_n", "rst_isp_top_axi";
interrupts = <92 87>;
+ starfive,aon-syscon = <&aon_syscon 0x00>;
status = "disabled";
};
static int stf_csi_power_on(struct stf_csi_dev *csi_dev, u8 on)
{
- void __iomem *aon_syscon;
+ struct stfcamss *stfcamss = csi_dev->stfcamss;
int ret;
if (on) {
regulator_disable(csi_dev->mipirx_0p9);
}
- aon_syscon = ioremap(0x17010000, 0x4);
- reg_write(aon_syscon, 0x00, 0x80000000);
+ regmap_write(stfcamss->stf_aon_syscon, stfcamss->aon_gp_reg, 0x80000000);
return 0;
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/uaccess.h>
+#include <linux/mfd/syscon.h>
#include <linux/videodev2.h>
struct stfcamss *stfcamss;
struct stf_vin_dev *vin;
struct device *dev = &pdev->dev;
+ struct of_phandle_args args;
int ret = 0, num_subdevs;
dev_info(dev, "stfcamss probe enter!\n");
return ret;
}
+ ret = of_parse_phandle_with_fixed_args(dev->of_node,
+ "starfive,aon-syscon", 1, 0, &args);
+ if (ret < 0) {
+ dev_err(dev, "Failed to parse starfive,aon-syscon\n");
+ return -EINVAL;
+ }
+
+ stfcamss->stf_aon_syscon = syscon_node_to_regmap(args.np);
+ of_node_put(args.np);
+ if (IS_ERR(stfcamss->stf_aon_syscon))
+ return PTR_ERR(stfcamss->stf_aon_syscon);
+
+ stfcamss->aon_gp_reg = args.args[0];
+
ret = stfcamss_get_mem_res(pdev, vin);
if (ret) {
st_err(ST_CAMSS, "Could not map registers\n");