hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
 * Copyright (c) 2023 Rockchip Electronics Co., Ltd.
 */
 
#ifndef _PWM_ROCKCHIP_IRQ_CALLBACKS_H_
#define _PWM_ROCKCHIP_IRQ_CALLBACKS_H_
 
#include <linux/pwm.h>
#include <linux/pwm-rockchip.h>
 
static void rockchip_pwm_oneshot_callback(struct pwm_device *pwm, struct pwm_state *state)
{
   /*
    * If you want to enable oneshot mode again, config and call
    * pwm_apply_state().
    *
    * struct pwm_state new_state;
    *
    * pwm_get_state(pwm, &new_state);
    * new_state.enabled = true;
    * ......
    * pwm_apply_state(pwm, &new_state);
    *
    */
}
 
static void rockchip_pwm_wave_middle_callback(struct pwm_device *pwm)
{
   /*
    * If you want to update the configuration of wave table, set
    * struct rockchip_pwm_wave_table and call rockchip_pwm_set_wave().
    *
    * struct rockchip_pwm_wave_config wave_config;
    * struct rockchip_pwm_wave_table duty_table;
    *
    * //fill the duty table
    * ......
    * wave_config.duty_table = &duty_table;
    * wave_config.enable = true;
    * rockchip_pwm_set_wave(pwm, &wave_config);
    *
    */
}
 
static void rockchip_pwm_wave_max_callback(struct pwm_device *pwm)
{
   /*
    * If you want to update the configuration of wave table, set
    * struct rockchip_pwm_wave_table and call rockchip_pwm_set_wave().
    *
    * struct rockchip_pwm_wave_config wave_config;
    * struct rockchip_pwm_wave_table duty_table;
    *
    * //fill the duty table
    * ......
    * wave_config.duty_table = &duty_table;
    * wave_config.enable = true;
    * rockchip_pwm_set_wave(pwm, &wave_config);
    *
    */
}
 
#endif