• Home
  • Raw
  • Download

Lines Matching refs:fan

54 static void gpd_pocket_fan_set_speed(struct gpd_pocket_fan_data *fan, int speed)  in gpd_pocket_fan_set_speed()  argument
56 if (speed == fan->last_speed) in gpd_pocket_fan_set_speed()
59 gpiod_direction_output(fan->gpio0, !!(speed & 1)); in gpd_pocket_fan_set_speed()
60 gpiod_direction_output(fan->gpio1, !!(speed & 2)); in gpd_pocket_fan_set_speed()
62 fan->last_speed = speed; in gpd_pocket_fan_set_speed()
75 struct gpd_pocket_fan_data *fan = in gpd_pocket_fan_worker() local
79 if (thermal_zone_get_temp(fan->dts0, &t0) || in gpd_pocket_fan_worker()
80 thermal_zone_get_temp(fan->dts1, &t1)) { in gpd_pocket_fan_worker()
81 dev_warn(fan->dev, "Error getting temperature\n"); in gpd_pocket_fan_worker()
88 speed = fan->last_speed; in gpd_pocket_fan_worker()
107 if (fan->last_speed <= 0 && speed) in gpd_pocket_fan_worker()
111 gpd_pocket_fan_set_speed(fan, speed); in gpd_pocket_fan_worker()
114 queue_delayed_work(system_wq, &fan->work, in gpd_pocket_fan_worker()
118 static void gpd_pocket_fan_force_update(struct gpd_pocket_fan_data *fan) in gpd_pocket_fan_force_update() argument
120 fan->last_speed = -1; in gpd_pocket_fan_force_update()
121 mod_delayed_work(system_wq, &fan->work, 0); in gpd_pocket_fan_force_update()
126 struct gpd_pocket_fan_data *fan; in gpd_pocket_fan_probe() local
150 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); in gpd_pocket_fan_probe()
151 if (!fan) in gpd_pocket_fan_probe()
154 fan->dev = &pdev->dev; in gpd_pocket_fan_probe()
155 INIT_DELAYED_WORK(&fan->work, gpd_pocket_fan_worker); in gpd_pocket_fan_probe()
158 fan->dts0 = thermal_zone_get_zone_by_name("soc_dts0"); in gpd_pocket_fan_probe()
159 if (IS_ERR(fan->dts0)) in gpd_pocket_fan_probe()
162 fan->dts1 = thermal_zone_get_zone_by_name("soc_dts1"); in gpd_pocket_fan_probe()
163 if (IS_ERR(fan->dts1)) in gpd_pocket_fan_probe()
166 fan->gpio0 = devm_gpiod_get_index(fan->dev, NULL, 0, GPIOD_ASIS); in gpd_pocket_fan_probe()
167 if (IS_ERR(fan->gpio0)) in gpd_pocket_fan_probe()
168 return PTR_ERR(fan->gpio0); in gpd_pocket_fan_probe()
170 fan->gpio1 = devm_gpiod_get_index(fan->dev, NULL, 1, GPIOD_ASIS); in gpd_pocket_fan_probe()
171 if (IS_ERR(fan->gpio1)) in gpd_pocket_fan_probe()
172 return PTR_ERR(fan->gpio1); in gpd_pocket_fan_probe()
174 gpd_pocket_fan_force_update(fan); in gpd_pocket_fan_probe()
176 platform_set_drvdata(pdev, fan); in gpd_pocket_fan_probe()
182 struct gpd_pocket_fan_data *fan = platform_get_drvdata(pdev); in gpd_pocket_fan_remove() local
184 cancel_delayed_work_sync(&fan->work); in gpd_pocket_fan_remove()
191 struct gpd_pocket_fan_data *fan = dev_get_drvdata(dev); in gpd_pocket_fan_suspend() local
193 cancel_delayed_work_sync(&fan->work); in gpd_pocket_fan_suspend()
194 gpd_pocket_fan_set_speed(fan, gpd_pocket_fan_min_speed()); in gpd_pocket_fan_suspend()
200 struct gpd_pocket_fan_data *fan = dev_get_drvdata(dev); in gpd_pocket_fan_resume() local
202 gpd_pocket_fan_force_update(fan); in gpd_pocket_fan_resume()