Skip to content

Commit 2a5c506

Browse files
SeWoon ParkHuisung Kang
SeWoon Park
authored and
Huisung Kang
committed
video: decon: mic: support hibernation display mode
@ DISP Block power off sequence (cont.d) 1. MIC core disable 2. MIC s/w reset for stabilization 3. SYSREG_DISP : MIC disable @ DISP Block power on sequence 1. SYSREG_DISP : MIC enable 2. MIC : initialization & start Change-Id: I4a571824174058832e3581130bd62d266742ad54 Signed-off-by: SeWoon Park <[email protected]>
1 parent 895c457 commit 2a5c506

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

drivers/video/decon_display/decon_mic.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ struct decon_mic {
4949
struct decon_mic *mic_for_decon;
5050
EXPORT_SYMBOL(mic_for_decon);
5151

52+
#ifdef CONFIG_FB_I80_COMMAND_MODE
53+
int decon_mic_hibernation_power_on(struct display_driver *dispdrv);
54+
int decon_mic_hibernation_power_off(struct display_driver *dispdrv);
55+
#endif
56+
5257
static int decon_mic_set_sys_reg(struct decon_mic *mic, bool enable)
5358
{
5459
u32 data;
@@ -175,6 +180,12 @@ int create_decon_mic(struct platform_device *pdev)
175180

176181
mic->decon_mic_on = true;
177182

183+
dispdrv->mic_driver.mic = mic;
184+
#ifdef CONFIG_FB_I80_COMMAND_MODE
185+
dispdrv->mic_driver.ops->pwr_on = decon_mic_hibernation_power_on;
186+
dispdrv->mic_driver.ops->pwr_off = decon_mic_hibernation_power_off;
187+
#endif
188+
178189
dev_info(dev, "MIC driver has been probed\n");
179190
return 0;
180191
}
@@ -214,6 +225,47 @@ int decon_mic_disable(struct decon_mic *mic)
214225
return 0;
215226
}
216227

228+
int decon_mic_sw_reset(struct decon_mic *mic)
229+
{
230+
void __iomem *regs = mic->reg_base + DECON_MIC_OP;
231+
232+
u32 data = readl(regs);
233+
234+
data |= DECON_MIC_SW_RST;
235+
writel(data, regs);
236+
237+
return 0;
238+
}
239+
240+
#ifdef CONFIG_FB_I80_COMMAND_MODE
241+
int decon_mic_hibernation_power_on(struct display_driver *dispdrv)
242+
{
243+
struct decon_mic *mic = dispdrv->mic_driver.mic;
244+
245+
decon_mic_set_sys_reg(mic, DECON_MIC_ON);
246+
decon_mic_set_image_size(mic);
247+
decon_mic_set_2d_bit_stream_size(mic);
248+
decon_mic_set_mic_base_operation(mic, DECON_MIC_ON);
249+
250+
mic->decon_mic_on = true;
251+
252+
return 0;
253+
}
254+
255+
int decon_mic_hibernation_power_off(struct display_driver *dispdrv)
256+
{
257+
struct decon_mic *mic = dispdrv->mic_driver.mic;
258+
259+
decon_mic_set_mic_base_operation(mic, DECON_MIC_OFF);
260+
decon_mic_sw_reset(mic);
261+
decon_mic_set_sys_reg(mic, DECON_MIC_OFF);
262+
263+
mic->decon_mic_on = false;
264+
265+
return 0;
266+
}
267+
#endif
268+
217269
MODULE_AUTHOR("Haowei Li <[email protected]>");
218270
MODULE_DESCRIPTION("Samsung MIC driver");
219271
MODULE_LICENSE("GPL");

drivers/video/decon_display/decon_mic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct mic_config {
1010
#define DECON_MIC_OP 0x00
1111
#define DECON_MIC_UPDATE_REG (1 << 31)
1212
#define DECON_MIC_ON_REG (1 << 30)
13+
#define DECON_MIC_SW_RST (1 << 4)
1314
#define DECON_MIC_NEW_CORE (0 << 2)
1415
#define DECON_MIC_OLD_CORE (1 << 2)
1516
#define DECON_MIC_VIDEO_MODE (0 << 1)

0 commit comments

Comments
 (0)