Skip to content

Commit a25ec23

Browse files
hoshinolinajannau
authored andcommitted
media: apple: isp: Add flicker_sensor_set cmd
Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent d21076a commit a25ec23

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

drivers/media/platform/apple/isp/isp-cmd.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define CISP_SEND_INOUT(x, a) (cisp_send((x), &(a), sizeof(a), sizeof(a), CISP_TIMEOUT))
1515
#define CISP_SEND_OUT(x, a) (cisp_send_read((x), (a), sizeof(*a), sizeof(*a)))
1616
#define CISP_POST_IN(x, a) (cisp_send((x), &(a), sizeof(a), 0, 0))
17+
#define CISP_POST_INOUT(x, a) (cisp_send((x), &(a), sizeof(a), sizeof(a), 0))
1718

1819
static int cisp_send(struct apple_isp *isp, void *args, u32 insize, u32 outsize, int timeout)
1920
{
@@ -204,6 +205,15 @@ int isp_cmd_ch_stop(struct apple_isp *isp, u32 chan)
204205
return CISP_SEND_IN(isp, args);
205206
}
206207

208+
int isp_cmd_flicker_sensor_set(struct apple_isp *isp, u32 mode)
209+
{
210+
struct cmd_flicker_sensor_set args = {
211+
.opcode = CISP_OPCODE(CISP_CMD_FLICKER_SENSOR_SET),
212+
.mode = mode,
213+
};
214+
return CISP_SEND_INOUT(isp, args);
215+
}
216+
207217
int isp_cmd_ch_info_get(struct apple_isp *isp, u32 chan,
208218
struct cmd_ch_info *args)
209219
{

drivers/media/platform/apple/isp/isp-cmd.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ struct cmd_ipc_endpoint_set2 {
232232
} __packed;
233233
static_assert(sizeof(struct cmd_ipc_endpoint_set2) == 0x30);
234234

235+
struct cmd_flicker_sensor_set {
236+
u64 opcode;
237+
u32 mode;
238+
} __packed;
239+
static_assert(sizeof(struct cmd_flicker_sensor_set) == 0xc);
240+
235241
int isp_cmd_start(struct apple_isp *isp, u32 mode);
236242
int isp_cmd_stop(struct apple_isp *isp, u32 mode);
237243
int isp_cmd_power_down(struct apple_isp *isp);
@@ -253,6 +259,7 @@ int isp_cmd_pmp_ctrl_set(struct apple_isp *isp, u64 clock_scratch,
253259
u8 bandwidth_bit, u8 bandwidth_size);
254260
int isp_cmd_fid_enter(struct apple_isp *isp);
255261
int isp_cmd_fid_exit(struct apple_isp *isp);
262+
int isp_cmd_flicker_sensor_set(struct apple_isp *isp, u32 mode);
256263

257264
struct cmd_ch_start {
258265
u64 opcode;

0 commit comments

Comments
 (0)