mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
46199b50cc
PD#SWPL-169759 Problem: align 20nm ddr thermal params to kernel5.4 Solution: 1. align 20nm ddr thermal params to kernel5.4 2. update ddr status when coolingdevice registerd Verify: t5d&t5w Change-Id: Ib33b715e790a72f2969dc69c3dec159589ae0d3f Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
|
/*
|
|
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __DDR_COOLING_H__
|
|
#define __DDR_COOLING_H__
|
|
|
|
#include <linux/thermal.h>
|
|
#include <linux/amlogic/meson_cooldev.h>
|
|
|
|
enum ddr_die_type {
|
|
DDR_TYPE1, /*20nm*/
|
|
DDR_TYPE2, /*18nm*/
|
|
DDR_TYPE_MAX
|
|
};
|
|
|
|
struct ddr_cooling_device {
|
|
int id;
|
|
struct thermal_cooling_device *cool_dev;
|
|
int ddr_reg_cnt;
|
|
u32 *ddr_reg;
|
|
void __iomem **vddr_reg;
|
|
u32 ddr_status;
|
|
u32 (*ddr_bits)[2];
|
|
u32 (*ddr_data)[20];
|
|
u32 *ddr_bits_keep; /*for keep ddr reg val excepts change bits*/
|
|
u32 last_state;
|
|
struct list_head node;
|
|
};
|
|
|
|
#ifdef CONFIG_AMLOGIC_DDR_THERMAL
|
|
|
|
struct thermal_cooling_device *ddr_cooling_register(struct device_node *np,
|
|
struct cool_dev *cool);
|
|
|
|
/**
|
|
* ddr_cooling_unregister - function to remove ddr cooling device.
|
|
* @cdev: thermal cooling device pointer.
|
|
*/
|
|
void ddr_cooling_unregister(struct thermal_cooling_device *cdev);
|
|
|
|
#else
|
|
|
|
static inline struct thermal_cooling_device *
|
|
ddr_cooling_register(struct device_node *np,
|
|
struct cool_dev *cool)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline
|
|
void ddr_cooling_unregister(struct thermal_cooling_device *cdev)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif /* __DDR_COOLING_H__ */
|