Lines Matching defs:cdev
206 struct npcm7xx_cooling_device *cdev[NPCM7XX_PWM_MAX_CHN_NUM];
781 struct npcm7xx_cooling_device *cdev = tcdev->devdata;
783 *state = cdev->max_state;
792 struct npcm7xx_cooling_device *cdev = tcdev->devdata;
794 *state = cdev->cur_state;
803 struct npcm7xx_cooling_device *cdev = tcdev->devdata;
806 if (state > cdev->max_state)
809 cdev->cur_state = state;
810 ret = npcm7xx_pwm_config_set(cdev->data, cdev->pwm_port,
811 cdev->cooling_levels[cdev->cur_state]);
828 struct npcm7xx_cooling_device *cdev;
830 cdev = devm_kzalloc(dev, sizeof(*cdev), GFP_KERNEL);
831 if (!cdev)
834 cdev->cooling_levels = devm_kzalloc(dev, num_levels, GFP_KERNEL);
835 if (!cdev->cooling_levels)
838 cdev->max_state = num_levels - 1;
840 cdev->cooling_levels,
846 snprintf(cdev->name, THERMAL_NAME_LENGTH, "%pOFn%d", child,
849 cdev->tcdev = devm_thermal_of_cooling_device_register(dev, child,
850 cdev->name, cdev, &npcm7xx_pwm_cool_ops);
851 if (IS_ERR(cdev->tcdev))
852 return PTR_ERR(cdev->tcdev);
854 cdev->data = data;
855 cdev->pwm_port = pwm_port;
857 data->cdev[pwm_port] = cdev;