Skip to content

Commit 886c006

Browse files
hoshinolinajannau
authored andcommitted
media: apple: isp: Add STOP and POWER_DOWN commands
Not sure if these work properly yet, but worth having them to experiment. Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent 7ddf82c commit 886c006

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ int isp_cmd_start(struct apple_isp *isp, u32 mode)
6060
return CISP_SEND_IN(isp, args);
6161
}
6262

63+
int isp_cmd_stop(struct apple_isp *isp, u32 mode)
64+
{
65+
struct cmd_stop args = {
66+
.opcode = CISP_OPCODE(CISP_CMD_STOP),
67+
.mode = mode,
68+
};
69+
return CISP_SEND_IN(isp, args);
70+
}
71+
72+
int isp_cmd_power_down(struct apple_isp *isp)
73+
{
74+
struct cmd_power_down args = {
75+
.opcode = CISP_OPCODE(CISP_CMD_POWER_DOWN),
76+
};
77+
return CISP_POST_INOUT(isp, args);
78+
}
79+
6380
int isp_cmd_suspend(struct apple_isp *isp)
6481
{
6582
struct cmd_suspend args = {

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define CISP_CMD_PRINT_ENABLE 0x0004
1313
#define CISP_CMD_BUILDINFO 0x0006
1414
#define CISP_CMD_GET_BES_PARAM 0x000f
15+
#define CISP_CMD_POWER_DOWN 0x0010
1516
#define CISP_CMD_SET_ISP_PMU_BASE 0x0011
1617
#define CISP_CMD_PMP_CTRL_SET 0x001c
1718
#define CISP_CMD_TRACE_ENABLE 0x001d
@@ -130,6 +131,17 @@ struct cmd_start {
130131
} __packed;
131132
static_assert(sizeof(struct cmd_start) == 0xc);
132133

134+
struct cmd_stop {
135+
u64 opcode;
136+
u32 mode;
137+
} __packed;
138+
static_assert(sizeof(struct cmd_stop) == 0xc);
139+
140+
struct cmd_power_down {
141+
u64 opcode;
142+
} __packed;
143+
static_assert(sizeof(struct cmd_power_down) == 0x8);
144+
133145
struct cmd_suspend {
134146
u64 opcode;
135147
} __packed;
@@ -221,6 +233,8 @@ struct cmd_ipc_endpoint_set2 {
221233
static_assert(sizeof(struct cmd_ipc_endpoint_set2) == 0x30);
222234

223235
int isp_cmd_start(struct apple_isp *isp, u32 mode);
236+
int isp_cmd_stop(struct apple_isp *isp, u32 mode);
237+
int isp_cmd_power_down(struct apple_isp *isp);
224238
int isp_cmd_suspend(struct apple_isp *isp);
225239
int isp_cmd_print_enable(struct apple_isp *isp, u32 enable);
226240
int isp_cmd_trace_enable(struct apple_isp *isp, u32 enable);

0 commit comments

Comments
 (0)