mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Merge commit 'a39ea4c1bc65ba79dfb1001de888e65a37c26b61'
* commit 'a39ea4c1bc65ba79dfb1001de888e65a37c26b61': power: supply: charger: add cps5601x charger driver input: touchscreen: gt1x: switch to using gpiod API soc: rockchip: decompress: add dynamic_buf_decom node for test ASoC: codecs: rv1106_codec: Use device_get_match_data() soc: rockchip: system_monitor: Use device_get_match_data() soc: rockchip: pvtm: Use device_get_match_data() phy: rockchip: mipi-rx: Use device_get_match_data() phy: rockchip: inno-usb3: Use device_get_match_data() phy: rockchip: csi2-dphy: Use device_get_match_data() phy: rockchip: csi2_dphy: Use device_get_match_data() Change-Id: I5a72094ef82b9be4552d481fab3d28ed9ff2927d
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
Binding for cps5601x battery charger
|
||||
|
||||
Required properties:
|
||||
- compatible: "cps,cps5601x" for cps5601x Charger Power Supply
|
||||
- monitored-battery: phandle of battery characteristics devicetree node
|
||||
- input-voltage-limit-microvolt: integer, input voltage level in uV, used to
|
||||
decrease voltage level when the over current
|
||||
of the input power source occurs.
|
||||
- input-current-limit-microamp: integer, input current value in uA drained by the
|
||||
charger from the power source.Default: 500000 uA (500mA)
|
||||
|
||||
child nodes:
|
||||
- vbus5v0_typec:
|
||||
Usage: optional
|
||||
Description: Regulator that is used to control the VBUS voltage direction for
|
||||
either USB host mode or for charging on the OTG port.
|
||||
|
||||
Example:
|
||||
|
||||
cps5601x: cps5601x@60 {
|
||||
compatible = "cps,cps5601x";
|
||||
reg = <0x60>;
|
||||
input-voltage-limit-microvolt = <4500000>;
|
||||
input-current-limit-microamp = <3000000>;
|
||||
monitored-battery = <&bat>;
|
||||
regulators {
|
||||
vbus5v0_typec: vbus5v0-typec {
|
||||
regulator-compatible = "otg-vbus";
|
||||
regulator-name = "vbus5v0_typec";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -31,8 +31,8 @@ static const struct dev_pm_ops gt1x_ts_pm_ops;
|
||||
#endif
|
||||
#ifdef GTP_CONFIG_OF
|
||||
bool gt1x_gt5688;
|
||||
int gt1x_rst_gpio;
|
||||
int gt1x_int_gpio;
|
||||
struct gpio_desc *gt1x_rst_gpio;
|
||||
struct gpio_desc *gt1x_int_gpio;
|
||||
static bool power_invert;
|
||||
#endif
|
||||
|
||||
@@ -321,19 +321,16 @@ static int gt1x_parse_dt(struct device *dev)
|
||||
gt1x_gt5688 = true;
|
||||
}
|
||||
|
||||
gt1x_int_gpio = of_get_named_gpio(np, "goodix,irq-gpio", 0);
|
||||
gt1x_rst_gpio = of_get_named_gpio(np, "goodix,rst-gpio", 0);
|
||||
|
||||
if (!gpio_is_valid(gt1x_int_gpio) && !gpio_is_valid(gt1x_rst_gpio)) {
|
||||
GTP_ERROR("Invalid GPIO, irq-gpio:%d, rst-gpio:%d",
|
||||
gt1x_int_gpio, gt1x_rst_gpio);
|
||||
return -EINVAL;
|
||||
gt1x_int_gpio = devm_gpiod_get(dev, "goodix,irq", GPIOD_IN);
|
||||
if (IS_ERR(gt1x_int_gpio)) {
|
||||
GTP_ERROR("Failed to get irq GPIO");
|
||||
return PTR_ERR(gt1x_int_gpio);
|
||||
}
|
||||
|
||||
if (!gpio_is_valid(gt1x_int_gpio)) {
|
||||
GTP_ERROR("Invalid GPIO, irq-gpio:%d",
|
||||
gt1x_int_gpio);
|
||||
return -EINVAL;
|
||||
gt1x_rst_gpio = devm_gpiod_get_optional(dev, "goodix,rst", GPIOD_OUT_LOW);
|
||||
if (IS_ERR(gt1x_rst_gpio)) {
|
||||
GTP_ERROR("Failed to get reset GPIO");
|
||||
return PTR_ERR(gt1x_rst_gpio);
|
||||
}
|
||||
|
||||
vdd_ana = devm_regulator_get_optional(dev, "vdd_ana");
|
||||
@@ -403,12 +400,6 @@ int gt1x_power_switch(int on)
|
||||
|
||||
static void gt1x_remove_gpio_and_power(void)
|
||||
{
|
||||
if (gpio_is_valid(gt1x_int_gpio))
|
||||
gpio_free(gt1x_int_gpio);
|
||||
|
||||
if (gpio_is_valid(gt1x_rst_gpio))
|
||||
gpio_free(gt1x_rst_gpio);
|
||||
|
||||
if (gt1x_i2c_client && gt1x_i2c_client->irq)
|
||||
free_irq(gt1x_i2c_client->irq, gt1x_i2c_client);
|
||||
}
|
||||
@@ -419,27 +410,15 @@ static void gt1x_remove_gpio_and_power(void)
|
||||
*/
|
||||
static s32 gt1x_request_io_port(void)
|
||||
{
|
||||
s32 ret = 0;
|
||||
|
||||
GTP_DEBUG_FUNC();
|
||||
ret = gpio_request(GTP_INT_PORT, "GTP_INT_IRQ");
|
||||
if (ret < 0) {
|
||||
GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_INT_PORT, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (IS_ERR_OR_NULL(gt1x_int_gpio))
|
||||
return -1;
|
||||
GTP_GPIO_AS_INT(GTP_INT_PORT);
|
||||
gt1x_i2c_client->irq = GTP_INT_IRQ;
|
||||
|
||||
if (gpio_is_valid(gt1x_rst_gpio)) {
|
||||
ret = gpio_request(GTP_RST_PORT, "GTP_RST_PORT");
|
||||
if (ret < 0) {
|
||||
GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_RST_PORT, ret);
|
||||
gpio_free(GTP_INT_PORT);
|
||||
return ret;
|
||||
}
|
||||
|
||||
GTP_GPIO_AS_INPUT(GTP_RST_PORT);
|
||||
if (gt1x_i2c_client->irq < 0) {
|
||||
GTP_ERROR("Failed to get IRQ from GPIO");
|
||||
return gt1x_i2c_client->irq;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -458,11 +437,12 @@ static s32 gt1x_request_irq(void)
|
||||
GTP_DEBUG_FUNC();
|
||||
GTP_DEBUG("INT trigger type:%x", gt1x_int_type);
|
||||
|
||||
if (IS_ERR_OR_NULL(gt1x_int_gpio))
|
||||
return -1;
|
||||
ret = request_irq(gt1x_i2c_client->irq, gt1x_ts_irq_handler, irq_table[gt1x_int_type], gt1x_i2c_client->name, gt1x_i2c_client);
|
||||
if (ret) {
|
||||
GTP_ERROR("Request IRQ failed!ERRNO:%d.", ret);
|
||||
GTP_GPIO_AS_INPUT(GTP_INT_PORT);
|
||||
gpio_free(GTP_INT_PORT);
|
||||
|
||||
return -1;
|
||||
} else {
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
#ifndef _GOODIX_GT1X_H_
|
||||
#define _GOODIX_GT1X_H_
|
||||
#include "gt1x_generic.h"
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#ifdef GTP_CONFIG_OF
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#endif
|
||||
#ifdef CONFIG_FB
|
||||
@@ -38,8 +37,8 @@
|
||||
/* Customize your I/O ports & I/O operations */
|
||||
#ifdef GTP_CONFIG_OF
|
||||
extern bool gt1x_gt5688;
|
||||
extern int gt1x_rst_gpio;
|
||||
extern int gt1x_int_gpio;
|
||||
extern struct gpio_desc *gt1x_int_gpio;
|
||||
extern struct gpio_desc *gt1x_rst_gpio;
|
||||
extern struct regulator *gt1x_supply;
|
||||
#define GTP_RST_PORT gt1x_rst_gpio
|
||||
#define GTP_INT_PORT gt1x_int_gpio
|
||||
@@ -48,17 +47,17 @@ extern struct regulator *gt1x_supply;
|
||||
#define GTP_INT_PORT 52
|
||||
#endif
|
||||
|
||||
#define GTP_INT_IRQ gpio_to_irq(GTP_INT_PORT)
|
||||
#define GTP_INT_IRQ gpiod_to_irq(GTP_INT_PORT)
|
||||
/*#define GTP_INT_CFG S3C_GPIO_SFN(0xF)*/
|
||||
|
||||
#define GTP_GPIO_AS_INPUT(pin) do {\
|
||||
gpio_direction_input(pin);\
|
||||
gpiod_direction_input(pin);\
|
||||
} while (0)
|
||||
#define GTP_GPIO_AS_INT(pin) do {\
|
||||
GTP_GPIO_AS_INPUT(pin);\
|
||||
} while (0)
|
||||
#define GTP_GPIO_GET_VALUE(pin) gpio_get_value(pin)
|
||||
#define GTP_GPIO_OUTPUT(pin, level) gpio_direction_output(pin, level)
|
||||
#define GTP_GPIO_GET_VALUE(pin) gpiod_get_raw_value(pin)
|
||||
#define GTP_GPIO_OUTPUT(pin, level) gpiod_direction_output_raw(pin, level)
|
||||
#define GTP_IRQ_TAB {IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH}
|
||||
|
||||
#endif /* _GOODIX_GT1X_H_ */
|
||||
|
||||
@@ -663,11 +663,11 @@ s32 gt1x_init_panel(void)
|
||||
|
||||
void gt1x_select_addr(void)
|
||||
{
|
||||
if (gpio_is_valid(gt1x_rst_gpio))
|
||||
if (!IS_ERR_OR_NULL(gt1x_rst_gpio))
|
||||
GTP_GPIO_OUTPUT(GTP_RST_PORT, 0);
|
||||
GTP_GPIO_OUTPUT(GTP_INT_PORT, gt1x_i2c_client->addr == 0x14);
|
||||
usleep_range(2000, 3000);
|
||||
if (gpio_is_valid(gt1x_rst_gpio))
|
||||
if (!IS_ERR_OR_NULL(gt1x_rst_gpio))
|
||||
GTP_GPIO_OUTPUT(GTP_RST_PORT, 1);
|
||||
usleep_range(2000, 3000);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <media/media-entity.h>
|
||||
@@ -1178,7 +1179,6 @@ static int rockchip_csi2_dphy_hw_probe(struct platform_device *pdev)
|
||||
struct csi2_dphy_hw *dphy_hw;
|
||||
struct regmap *grf;
|
||||
struct resource *res;
|
||||
const struct of_device_id *of_id;
|
||||
const struct dphy_hw_drv_data *drv_data;
|
||||
|
||||
dphy_hw = devm_kzalloc(dev, sizeof(*dphy_hw), GFP_KERNEL);
|
||||
@@ -1186,12 +1186,10 @@ static int rockchip_csi2_dphy_hw_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
dphy_hw->dev = dev;
|
||||
|
||||
of_id = of_match_device(rockchip_csi2_dphy_hw_match_id, dev);
|
||||
if (!of_id)
|
||||
drv_data = device_get_match_data(dev);
|
||||
if (!drv_data)
|
||||
return -EINVAL;
|
||||
|
||||
drv_data = of_id->data;
|
||||
|
||||
grf = syscon_regmap_lookup_by_phandle(dev->of_node,
|
||||
"rockchip,grf");
|
||||
if (IS_ERR(grf)) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <media/media-entity.h>
|
||||
@@ -1171,7 +1172,6 @@ static int rockchip_csi2_dphy_get_hw(struct csi2_dphy *dphy)
|
||||
static int rockchip_csi2_dphy_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
const struct of_device_id *of_id;
|
||||
struct csi2_dphy *csi2dphy;
|
||||
struct v4l2_subdev *sd;
|
||||
const struct dphy_drv_data *drv_data;
|
||||
@@ -1182,10 +1182,9 @@ static int rockchip_csi2_dphy_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
csi2dphy->dev = dev;
|
||||
|
||||
of_id = of_match_device(rockchip_csi2_dphy_match_id, dev);
|
||||
if (!of_id)
|
||||
drv_data = device_get_match_data(dev);
|
||||
if (!drv_data)
|
||||
return -EINVAL;
|
||||
drv_data = of_id->data;
|
||||
csi2dphy->drv_data = drv_data;
|
||||
|
||||
csi2dphy->phy_index = of_alias_get_id(dev->of_node, drv_data->dev_name);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/phy/phy.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/usb/phy.h>
|
||||
@@ -827,12 +828,11 @@ static int rockchip_u3phy_probe(struct platform_device *pdev)
|
||||
struct phy_provider *provider;
|
||||
struct rockchip_u3phy *u3phy;
|
||||
const struct rockchip_u3phy_cfg *phy_cfgs;
|
||||
const struct of_device_id *match;
|
||||
unsigned int reg[2];
|
||||
int index, ret;
|
||||
|
||||
match = of_match_device(dev->driver->of_match_table, dev);
|
||||
if (!match || !match->data) {
|
||||
phy_cfgs = device_get_match_data(dev);
|
||||
if (!phy_cfgs) {
|
||||
dev_err(dev, "phy-cfgs are not assigned!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -861,7 +861,6 @@ static int rockchip_u3phy_probe(struct platform_device *pdev)
|
||||
|
||||
u3phy->dev = dev;
|
||||
u3phy->vbus_enabled = false;
|
||||
phy_cfgs = match->data;
|
||||
platform_set_drvdata(pdev, u3phy);
|
||||
|
||||
/* find out a proper config which can be matched with dt. */
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <media/media-entity.h>
|
||||
@@ -1801,7 +1802,6 @@ static int rockchip_mipidphy_probe(struct platform_device *pdev)
|
||||
struct mipidphy_priv *priv;
|
||||
struct regmap *grf;
|
||||
struct resource *res;
|
||||
const struct of_device_id *of_id;
|
||||
const struct dphy_drv_data *drv_data;
|
||||
int i, ret;
|
||||
|
||||
@@ -1810,10 +1810,6 @@ static int rockchip_mipidphy_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
priv->dev = dev;
|
||||
|
||||
of_id = of_match_device(rockchip_mipidphy_match_id, dev);
|
||||
if (!of_id)
|
||||
return -EINVAL;
|
||||
|
||||
grf = syscon_node_to_regmap(dev->parent->of_node);
|
||||
if (IS_ERR(grf)) {
|
||||
grf = syscon_regmap_lookup_by_phandle(dev->of_node,
|
||||
@@ -1829,9 +1825,11 @@ static int rockchip_mipidphy_probe(struct platform_device *pdev)
|
||||
if (priv->phy_index < 0)
|
||||
priv->phy_index = 0;
|
||||
|
||||
drv_data = of_id->data;
|
||||
drv_data = device_get_match_data(dev);
|
||||
if (soc_is_px30s())
|
||||
drv_data = &rk3326s_mipidphy_drv_data;
|
||||
if (!drv_data)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < drv_data->num_clks; i++) {
|
||||
priv->clks[i] = devm_clk_get(dev, drv_data->clks[i]);
|
||||
|
||||
@@ -490,6 +490,14 @@ config CHARGER_CPCAP
|
||||
Say Y to enable support for CPCAP PMIC charger driver for Motorola
|
||||
mobile devices such as Droid 4.
|
||||
|
||||
config CHARGER_CPS5601X
|
||||
tristate "CPS5601X charger driver"
|
||||
depends on I2C
|
||||
depends on GPIOLIB || COMPILE_TEST
|
||||
select REGMAP_I2C
|
||||
help
|
||||
Say Y to enable support for the CPS5601X battery charger.
|
||||
|
||||
config CHARGER_ISP1704
|
||||
tristate "ISP1704 USB Charger Detection"
|
||||
depends on USB_PHY
|
||||
|
||||
@@ -66,6 +66,7 @@ obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
|
||||
obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o
|
||||
obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o ab8500_chargalg.o
|
||||
obj-$(CONFIG_CHARGER_CPCAP) += cpcap-charger.o
|
||||
obj-$(CONFIG_CHARGER_CPS5601X) += cps5601x_charger.o
|
||||
obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
|
||||
obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o
|
||||
obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o
|
||||
|
||||
1256
drivers/power/supply/cps5601x_charger.c
Normal file
1256
drivers/power/supply/cps5601x_charger.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/soc/rockchip/rockchip_decompress.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
#define DECOM_CTRL 0x0
|
||||
#define DECOM_ENR 0x4
|
||||
@@ -314,8 +315,138 @@ static ssize_t start_decom_store(struct device *dev,
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_WO(start_decom);
|
||||
|
||||
static void *uncomp_virt;
|
||||
static dma_addr_t uncomp_phys;
|
||||
|
||||
static void *comp_virt;
|
||||
static dma_addr_t comp_phys;
|
||||
|
||||
static void *decomp_virt;
|
||||
static dma_addr_t decomp_phys;
|
||||
|
||||
static size_t uncomp_size;
|
||||
static size_t comp_size;
|
||||
|
||||
#define RK_DECOME_TIMEOUT 3 /* 3 seconds */
|
||||
|
||||
#define FILE_UNCOMPRESSED "/data/data/asyoulik.txt"
|
||||
#define FILE_COMPRESSED "/data/data/asyoulik.tar.gz"
|
||||
|
||||
static int decompress_and_compare(struct rk_decom *rk_decom, int mode)
|
||||
{
|
||||
struct file *file1 = NULL, *file2 = NULL;
|
||||
int ret = -EINVAL;
|
||||
u64 decom_len;
|
||||
loff_t pos;
|
||||
|
||||
pr_info("Starting decompress and compare operation\n");
|
||||
|
||||
file1 = filp_open(FILE_UNCOMPRESSED, O_RDONLY, 0);
|
||||
if (IS_ERR(file1))
|
||||
goto err_file1;
|
||||
|
||||
file2 = filp_open(FILE_COMPRESSED, O_RDONLY, 0);
|
||||
if (IS_ERR(file2))
|
||||
goto err_file2;
|
||||
|
||||
uncomp_size = file1->f_inode->i_size;
|
||||
comp_size = file2->f_inode->i_size;
|
||||
|
||||
pr_info("Uncompressed file size: %zu bytes\n", uncomp_size);
|
||||
|
||||
uncomp_virt = dma_alloc_coherent(rk_decom->dev, uncomp_size,
|
||||
&uncomp_phys, GFP_KERNEL);
|
||||
if (!uncomp_virt)
|
||||
goto out_free;
|
||||
|
||||
comp_virt = dma_alloc_coherent(rk_decom->dev, comp_size, &comp_phys,
|
||||
GFP_KERNEL);
|
||||
if (!comp_virt)
|
||||
goto out_free1;
|
||||
|
||||
decomp_virt = dma_alloc_coherent(rk_decom->dev, uncomp_size * 2,
|
||||
&decomp_phys, GFP_KERNEL);
|
||||
if (!decomp_virt)
|
||||
goto out_free2;
|
||||
|
||||
pos = 0;
|
||||
if (kernel_read(file1, uncomp_virt, uncomp_size, &pos) < 0) {
|
||||
pr_err("Failed to read uncompressed file\n");
|
||||
goto out_free3;
|
||||
}
|
||||
filp_close(file1, NULL);
|
||||
file1 = NULL;
|
||||
|
||||
pos = 0;
|
||||
if (kernel_read(file2, comp_virt, comp_size, &pos) < 0) {
|
||||
pr_err("Failed to read compressed file\n");
|
||||
goto out_free3;
|
||||
}
|
||||
filp_close(file2, NULL);
|
||||
file2 = NULL;
|
||||
|
||||
ret = rk_decom_start(mode, comp_phys, decomp_phys, 0x80000000);
|
||||
if (ret) {
|
||||
pr_err("rk_decom_start failed[%d].", ret);
|
||||
goto out_free3;
|
||||
}
|
||||
|
||||
ret = rk_decom_wait_done(RK_DECOME_TIMEOUT, &decom_len);
|
||||
pr_info("Decompression %lld completed\n", decom_len);
|
||||
|
||||
pr_info("Comparing files...\n");
|
||||
if (memcmp(uncomp_virt, decomp_virt, uncomp_size) == 0) {
|
||||
pr_info("Files match exactly!\n");
|
||||
ret = 0;
|
||||
} else {
|
||||
pr_info("Files differ\n");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
out_free3:
|
||||
dma_free_coherent(rk_decom->dev, uncomp_size * 2, decomp_virt,
|
||||
decomp_phys);
|
||||
out_free2:
|
||||
dma_free_coherent(rk_decom->dev, comp_size, comp_virt, comp_phys);
|
||||
out_free1:
|
||||
dma_free_coherent(rk_decom->dev, uncomp_size, uncomp_virt, uncomp_phys);
|
||||
out_free:
|
||||
if (file2)
|
||||
filp_close(file2, NULL);
|
||||
err_file2:
|
||||
if (file1)
|
||||
filp_close(file1, NULL);
|
||||
err_file1:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t dynamic_buf_decom_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
u32 mode;
|
||||
int ret;
|
||||
struct rk_decom *rk_dec = dev_get_drvdata(dev);
|
||||
|
||||
ret = kstrtou32(buf, 10, &mode);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (mode != LZ4_MOD && mode != GZIP_MOD && mode != ZLIB_MOD)
|
||||
return -EINVAL;
|
||||
|
||||
ret = decompress_and_compare(rk_dec, mode);
|
||||
if (ret)
|
||||
pr_info("%s, user decompress error\n", __func__);
|
||||
|
||||
return size;
|
||||
}
|
||||
static DEVICE_ATTR_WO(dynamic_buf_decom);
|
||||
|
||||
static struct attribute *decom_attrs[] = {
|
||||
&dev_attr_start_decom.attr,
|
||||
&dev_attr_dynamic_buf_decom.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -348,14 +479,18 @@ static int __init rockchip_decom_probe(struct platform_device *pdev)
|
||||
mem = of_parse_phandle(np, "memory-region", 0);
|
||||
if (!mem) {
|
||||
dev_err(dev, "missing \"memory-region\" property\n");
|
||||
#ifndef CONFIG_ROCKCHIP_HW_DECOMPRESS_TEST
|
||||
return -ENODEV;
|
||||
#endif
|
||||
}
|
||||
|
||||
ret = of_address_to_resource(mem, 0, ®);
|
||||
of_node_put(mem);
|
||||
if (ret) {
|
||||
dev_err(dev, "missing \"reg\" property\n");
|
||||
#ifndef CONFIG_ROCKCHIP_HW_DECOMPRESS_TEST
|
||||
return -ENODEV;
|
||||
#endif
|
||||
}
|
||||
|
||||
rk_dec->mem_start = reg.start;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/of_clk.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -983,13 +984,13 @@ static int rockchip_pvtm_probe(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct device_node *node;
|
||||
const struct of_device_id *match;
|
||||
const struct rockchip_pvtm_data *data;
|
||||
struct rockchip_pvtm *pvtm;
|
||||
struct regmap *grf = NULL;
|
||||
void __iomem *base = NULL;
|
||||
|
||||
match = of_match_device(dev->driver->of_match_table, dev);
|
||||
if (!match || !match->data) {
|
||||
data = device_get_match_data(dev);
|
||||
if (!data) {
|
||||
dev_err(dev, "missing pvtm data\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1005,7 +1006,7 @@ static int rockchip_pvtm_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
for_each_available_child_of_node(np, node) {
|
||||
pvtm = rockchip_pvtm_init(dev, node, match->data, grf, base);
|
||||
pvtm = rockchip_pvtm_init(dev, node, data, grf, base);
|
||||
if (!pvtm) {
|
||||
dev_err(dev, "failed to handle node %s\n",
|
||||
node->full_name);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/pm_opp.h>
|
||||
#include <linux/pm_qos.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/regulator/coupler.h>
|
||||
#include <linux/regulator/driver.h>
|
||||
@@ -1909,7 +1910,6 @@ MODULE_DEVICE_TABLE(of, rockchip_system_monitor_of_match);
|
||||
static int rockchip_system_monitor_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
const struct of_device_id *match;
|
||||
int (*init)(struct platform_device *pdev);
|
||||
|
||||
system_monitor = devm_kzalloc(dev, sizeof(struct system_monitor),
|
||||
@@ -1933,11 +1933,9 @@ static int rockchip_system_monitor_probe(struct platform_device *pdev)
|
||||
|
||||
rockchip_system_monitor_parse_dt(system_monitor);
|
||||
|
||||
match = of_match_device(rockchip_system_monitor_of_match, &pdev->dev);
|
||||
if (match && match->data) {
|
||||
init = match->data;
|
||||
init = device_get_match_data(dev);
|
||||
if (init)
|
||||
init(pdev);
|
||||
}
|
||||
|
||||
if (system_monitor->tz) {
|
||||
system_monitor->last_temp = INT_MAX;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/reset.h>
|
||||
@@ -2131,7 +2132,6 @@ MODULE_DEVICE_TABLE(of, rv1106_codec_of_match);
|
||||
|
||||
static int rv1106_platform_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct of_device_id *of_id;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct rv1106_codec_priv *rv1106;
|
||||
struct resource *res;
|
||||
@@ -2142,9 +2142,7 @@ static int rv1106_platform_probe(struct platform_device *pdev)
|
||||
if (!rv1106)
|
||||
return -ENOMEM;
|
||||
|
||||
of_id = of_match_device(rv1106_codec_of_match, &pdev->dev);
|
||||
if (of_id)
|
||||
rv1106->soc_id = (enum soc_id_e)of_id->data;
|
||||
rv1106->soc_id = (enum soc_id_e)device_get_match_data(&pdev->dev);
|
||||
dev_info(&pdev->dev, "current soc_id: rv%x\n", rv1106->soc_id);
|
||||
|
||||
rv1106->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
|
||||
|
||||
Reference in New Issue
Block a user