Lines Matching refs:cdev
209 struct npcm7xx_cooling_device *cdev[NPCM7XX_PWM_MAX_CHN_NUM];
798 struct npcm7xx_cooling_device *cdev = tcdev->devdata;
800 *state = cdev->max_state;
809 struct npcm7xx_cooling_device *cdev = tcdev->devdata;
811 *state = cdev->cur_state;
820 struct npcm7xx_cooling_device *cdev = tcdev->devdata;
823 if (state > cdev->max_state)
826 cdev->cur_state = state;
827 ret = npcm7xx_pwm_config_set(cdev->data, cdev->pwm_port,
828 cdev->cooling_levels[cdev->cur_state]);
845 struct npcm7xx_cooling_device *cdev;
847 cdev = devm_kzalloc(dev, sizeof(*cdev), GFP_KERNEL);
848 if (!cdev)
851 cdev->cooling_levels = devm_kzalloc(dev, num_levels, GFP_KERNEL);
852 if (!cdev->cooling_levels)
855 cdev->max_state = num_levels - 1;
857 cdev->cooling_levels,
863 snprintf(cdev->name, THERMAL_NAME_LENGTH, "%pOFn%d", child,
866 cdev->tcdev = devm_thermal_of_cooling_device_register(dev, child,
867 cdev->name, cdev, &npcm7xx_pwm_cool_ops);
868 if (IS_ERR(cdev->tcdev))
869 return PTR_ERR(cdev->tcdev);
871 cdev->data = data;
872 cdev->pwm_port = pwm_port;
874 data->cdev[pwm_port] = cdev;