pixel_probe: tl1 add pixel probe control for debug [1/1]

PD#SWPL-9137

Problem:
tl1 add APIs to control pixel probe for debug

Solution:
tl1 add APIs to control pixel probe for debug

Verify:
X301

this commit MUST not be merged into trunk!!!

Change-Id: I3a538ff3afdd80ef5669fac63a3ab5f43b8e1055
Signed-off-by: Yan Wang <yan.wang@amlogic.com>

Conflicts:
	arch/arm/configs/meson64_a32_defconfig
	arch/arm64/configs/meson64_defconfig
	drivers/amlogic/Kconfig
This commit is contained in:
Yan Wang
2019-06-12 16:19:17 +08:00
committed by Luke Go
parent 04fedcc7e8
commit 19c12e7f88
12 changed files with 203 additions and 2 deletions

View File

@@ -14879,6 +14879,11 @@ HARDKERNEL S922D odroidn2
M: Pierluigi Passaro <info@phoenixsoftware.it>
F: drivers/input/touchscreen/sx8650.c
AMLOGIC TL1 PIXEL PROBE
M: Yan Wang <yan.wang@amlogic.com>
F: drivers/amlogic/pixel_probe/*
F: include/linux/amlogic/pixel_probe.h
HARDKERNEL S922D odroidn2
M: charles park <charles.park@hardkernel.com>
F: Documentation/devicetree/binding/input/touchscreen/sx8650.txt

View File

@@ -180,6 +180,12 @@
reserve_mem_size = <0x00300000>;
};
pixel_probe {
compatible = "amlogic, pixel_probe";
vpp_probe_func = <0x820000f1>;
vdin_probe_func = <0x820000f2>;
};
securitykey {
compatible = "amlogic, securitykey";
status = "okay";

View File

@@ -378,6 +378,7 @@ CONFIG_AMLOGIC_DEBUG_LOCKUP=y
CONFIG_AMLOGIC_DEFENDKEY=y
CONFIG_AMLOGIC_BATTERY_DUMMY=y
CONFIG_AMLOGIC_CHARGER_DUMMY=y
CONFIG_AMLOGIC_PIXEL_PROBE=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y

View File

@@ -169,6 +169,12 @@
reserve_mem_size = <0x00300000>;
};
pixel_probe {
compatible = "amlogic, pixel_probe";
vpp_probe_func = <0x820000f1>;
vdin_probe_func = <0x820000f2>;
};
securitykey {
compatible = "amlogic, securitykey";
status = "okay";

View File

@@ -373,6 +373,7 @@ CONFIG_AMLOGIC_DEFENDKEY=y
CONFIG_AMLOGIC_BATTERY_DUMMY=y
CONFIG_AMLOGIC_CHARGER_DUMMY=y
CONFIG_DOLBY_FW=y
CONFIG_AMLOGIC_PIXEL_PROBE=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y

View File

@@ -138,5 +138,7 @@ source "drivers/amlogic/spi-nor/Kconfig"
source "drivers/amlogic/dolby_fw/Kconfig"
source "drivers/amlogic/pixel_probe/Kconfig"
endmenu
endif

View File

@@ -135,3 +135,5 @@ obj-$(CONFIG_AMLOGIC_DEFENDKEY) += defendkey/
obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
obj-$(CONFIG_DOLBY_FW) += dolby_fw/
obj-$(CONFIG_AMLOGIC_PIXEL_PROBE) += pixel_probe/

View File

@@ -0,0 +1,9 @@
#
# Amlogic pixel probe driver
#
config AMLOGIC_PIXEL_PROBE
bool "Amlogic pixel probe control"
default n
help
This is the Amlogic pixel probe driver
this config only ctrl in makefile

View File

@@ -0,0 +1 @@
obj-$(CONFIG_AMLOGIC_PIXEL_PROBE) += pixel_probe.o

View File

@@ -0,0 +1,144 @@
/*
* drivers/amlogic/pixel_probe/pixel_probe.c
*
* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/module.h>
#include <linux/of_fdt.h>
#include <linux/libfdt_env.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/dma-contiguous.h>
#include <asm/compiler.h>
#include <linux/cma.h>
#include <linux/arm-smccc.h>
#undef pr_fmt
#define pr_fmt(fmt) "pixel_probe: " fmt
static DEFINE_MUTEX(pixel_probe_mutex);
static unsigned int vpp_probe_func;
static unsigned int vdin_probe_func;
#define PROBE_ENABLE 1
#define PROBE_DISABLE 0
static int pixel_probe_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
if (of_property_read_u32(np, "vpp_probe_func", &vpp_probe_func)) {
pr_err("can't get vpp probe command!\n");
return -1;
}
if (of_property_read_u32(np, "vdin_probe_func", &vdin_probe_func)) {
pr_err("can't get vdin probe command!\n");
return -1;
}
return 0;
}
static const struct of_device_id pixel_probe_dt_match[] = {
{ .compatible = "amlogic, pixel_probe" },
{ /* sentinel */ },
};
static struct platform_driver pixel_probe_platform_driver = {
.probe = pixel_probe_probe,
.driver = {
.owner = THIS_MODULE,
.name = "pixel",
.of_match_table = pixel_probe_dt_match,
},
};
int __init meson_pixel_probe_init(void)
{
int ret;
ret = platform_driver_register(&pixel_probe_platform_driver);
return ret;
}
subsys_initcall(meson_pixel_probe_init);
int vpp_probe_enable(void)
{
struct arm_smccc_res res;
if (!vpp_probe_func) {
pr_err("vpp probe func error!\n");
return -1;
}
mutex_lock(&pixel_probe_mutex);
arm_smccc_smc(vpp_probe_func, PROBE_ENABLE, 0, 0, 0, 0, 0, 0, &res);
mutex_unlock(&pixel_probe_mutex);
return res.a0;
}
int vpp_probe_disable(void)
{
struct arm_smccc_res res;
if (!vpp_probe_func) {
pr_err("vpp probe func error!\n");
return -1;
}
mutex_lock(&pixel_probe_mutex);
arm_smccc_smc(vpp_probe_func, PROBE_DISABLE, 0, 0, 0, 0, 0, 0, &res);
mutex_unlock(&pixel_probe_mutex);
return res.a0;
}
int vdin_probe_enable(void)
{
struct arm_smccc_res res;
if (!vdin_probe_func) {
pr_err("vdin probe func error!\n");
return -1;
}
mutex_lock(&pixel_probe_mutex);
arm_smccc_smc(vdin_probe_func, PROBE_ENABLE, 0, 0, 0, 0, 0, 0, &res);
mutex_unlock(&pixel_probe_mutex);
return res.a0;
}
int vdin_probe_disable(void)
{
struct arm_smccc_res res;
if (!vdin_probe_func) {
pr_err("vdin probe func error!\n");
return -1;
}
mutex_lock(&pixel_probe_mutex);
arm_smccc_smc(vdin_probe_func, PROBE_DISABLE, 0, 0, 0, 0, 0, 0, &res);
mutex_unlock(&pixel_probe_mutex);
return res.a0;
}

View File

@@ -1,6 +1,5 @@
# Amlogic secure monitor driver
config AMLOGIC_SEC
bool "Amlogic secure monitor driver support"
default n
@@ -9,4 +8,3 @@ config AMLOGIC_SEC
this config only ctrl in makefile
prepare share memory
etc

View File

@@ -0,0 +1,26 @@
/*
* include/linux/amlogic/pixel_probe.h
*
* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#ifndef __PIXEL_PROBE_H__
#define __PIXEL_PROBE_H__
int vpp_probe_enable(void);
int vpp_probe_disable(void);
int vdin_probe_enable(void);
int vdin_probe_disable(void);
#endif