]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
thermal: as3722 thermal alarm driver
authorBibek Basu <bbasu@nvidia.com>
Tue, 17 Jun 2014 05:55:31 +0000 (11:25 +0530)
committerDan Willemsen <dwillemsen@nvidia.com>
Wed, 18 Mar 2015 18:58:29 +0000 (11:58 -0700)
Added driver which detects over temperature based on
sensors present along with the regulators SD0, SD1 and SD6.
If there is over temperature due to overcurrent drawn,
the driver helps in detecting it and start passive throttling

Change-Id: I976ded28320e848c61aa4a0115ce9f955056ed54
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/424063
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/mfd/as3722.c

index 31379ab7ea00a27800deae3a30541af9f98916bf..0ddf962fb7194982284ce5f8cfb98b78bd916998 100644 (file)
@@ -43,6 +43,7 @@ enum {
        AS3722_ADC,
        AS3722_POWER_OFF_ID,
        AS3722_CLK_ID,
+       AS3722_THERMAL_ID,
        AS3722_WATCHDOG_ID,
 };
 
@@ -64,6 +65,27 @@ static const struct resource as3722_adc_resource[] = {
        },
 };
 
+static const struct resource as3722_thermal_resource[] = {
+       {
+               .name = "as3722-sd0-alarm",
+               .start = AS3722_IRQ_TEMP_SD0_ALARM,
+               .end = AS3722_IRQ_TEMP_SD0_ALARM,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .name = "as3722-sd1-alarm",
+               .start = AS3722_IRQ_TEMP_SD1_ALARM,
+               .end = AS3722_IRQ_TEMP_SD1_ALARM,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .name = "as3722-sd6-alarm",
+               .start = AS3722_IRQ_TEMP_SD6_ALARM,
+               .end = AS3722_IRQ_TEMP_SD6_ALARM,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
 static const struct mfd_cell as3722_devs[] = {
        {
                .name = "as3722-pinctrl",
@@ -93,6 +115,12 @@ static const struct mfd_cell as3722_devs[] = {
                .name = "as3722-power-off",
                .id = AS3722_POWER_OFF_ID,
        },
+       {
+               .name = "as3722-thermal",
+               .num_resources = ARRAY_SIZE(as3722_thermal_resource),
+               .resources = as3722_thermal_resource,
+               .id = AS3722_THERMAL_ID,
+       },
        {
                .name = "as3722-wdt",
                .id = AS3722_WATCHDOG_ID,