Lines Matching +full:nxp +full:- +full:imx

1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2018-2020 NXP.
6 #include <dt-bindings/firmware/imx/rsrc.h>
8 #include <linux/firmware/imx/sci.h>
51 msg.data.req.resource_id = sensor->resource_id; in imx_sc_thermal_get_temp()
54 hdr->ver = IMX_SC_RPC_VERSION; in imx_sc_thermal_get_temp()
55 hdr->svc = IMX_SC_RPC_SVC_MISC; in imx_sc_thermal_get_temp()
56 hdr->func = IMX_SC_MISC_FUNC_GET_TEMP; in imx_sc_thermal_get_temp()
57 hdr->size = 2; in imx_sc_thermal_get_temp()
82 resource_id = of_device_get_match_data(&pdev->dev); in imx_sc_thermal_probe()
84 return -EINVAL; in imx_sc_thermal_probe()
88 sensor = devm_kzalloc(&pdev->dev, sizeof(*sensor), GFP_KERNEL); in imx_sc_thermal_probe()
90 return -ENOMEM; in imx_sc_thermal_probe()
92 sensor->resource_id = resource_id[i]; in imx_sc_thermal_probe()
94 sensor->tzd = devm_thermal_of_zone_register(&pdev->dev, sensor->resource_id, in imx_sc_thermal_probe()
96 if (IS_ERR(sensor->tzd)) { in imx_sc_thermal_probe()
100 * use-after-free error in imx_sc_thermal_probe()
102 ret = PTR_ERR(sensor->tzd); in imx_sc_thermal_probe()
104 devm_kfree(&pdev->dev, sensor); in imx_sc_thermal_probe()
111 if (ret == -ENODEV) in imx_sc_thermal_probe()
114 return dev_err_probe(&pdev->dev, ret, "failed to register thermal zone\n"); in imx_sc_thermal_probe()
117 devm_thermal_add_hwmon_sysfs(&pdev->dev, sensor->tzd); in imx_sc_thermal_probe()
127 IMX_SC_R_DRC_0, -1 };
130 { .compatible = "fsl,imx-sc-thermal", .data = imx_sc_sensors },
138 .name = "imx-sc-thermal",
144 MODULE_AUTHOR("Anson Huang <Anson.Huang@nxp.com>");
145 MODULE_DESCRIPTION("Thermal driver for NXP i.MX SoCs with system controller");