Get the calibration parameters for each chip by reading the OTP,
Calculate temperature using calibration parameters.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I05cfb65ae95dcefc7fc52ed91326c7da9d27de55
RK1000 is a digital-analog mixed chip which has tve output function.
RK1000's registers can be written and read through I2C interaface.
Because RK1000's I2C need dclk and mclk, RK1000 TVE should be registered
after RK1000 CORE.
Change-Id: I65b40826bd1dbf07d4fa94ecdf8c75005008731f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This patch disable USB Gadget functions UAC1/UAC2/UVC/RNDIS,
and only support F_FS for ADB.
Change-Id: If04bb18f9c620299dde4b2452e418e63badeec12
Signed-off-by: William Wu <william.wu@rock-chips.com>
rockchip_otp_module_init() depends on nvmem_init() to init nvmem_bus_type.
But rockchip_otp_module_init() and nvmem_init() are both in the same
subsys_initcall level.
Change-Id: I58bc66519fb76179be3e6a170048a67c0861b224
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
The size of vendor_info need align to 4KB and compatible with uboot.
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I16ae2cf5c976032e944bfb590d38ec89831f9b2f
dmarx isr is unreliable, using MI frame end to replace it
Change-Id: Iabb4f405aedf3e81995d009ce2f4bddce2d12ed3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
1.The reset signal is directly controlled by GPIO,
so there is no need to wait for the delay of RC circuit
2.Correct the level setting of reset signal
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I808a7ba13f23f630d1ab9d11c54cb33a1e85123c
drivers/input/sensors/sensor-dev.c:1600:5: warning:
no previous prototype for 'sensor_probe' [-Wmissing-prototypes]
drivers/input/sensors/sensor-dev.c:1854:3: warning:
this statement may fall through [-Wimplicit-fallthrough=]
drivers/input/sensors/sensor-dev.c:1857 sensor_probe() warn:
missing break? reassigning 'sensor->input_dev->name'
drivers/input/sensors/sensor-dev.c:1602:30: warning:
Value stored to 'sensor' during its initialization is never read
drivers/input/sensors/sensor-dev.c:504:3: warning:
Value stored to 'result' is never read
Unneeded variable: "result". Return "0" on line 893
Unneeded variable: "result". Return "0" on line 908
Fixes: a32d316fcc ("driver: sensors: improve sensor driver to pass android vts test")
Change-Id: I95bdc5373694e0a78f9a29583a3138e14eae6126
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
make distclean
scripts/Makefile.clean:15: drivers/gpu/arm/midgard_for_linux/Makefile:
No such file or directory
Fixes: 25bb952677 ("MALI: rockchip: remove drivers/gpu/arm/midgard_for_linux/")
Change-Id: Ia47e2581d9679f3bcca809ad4506b61068e1710d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
The FUSB302 will stop toggling with a FUSB_REG_STATUS1A_TOGSS_SRC? status,
as soon as it sees either Ra or Rd on a CC pin.
Before this commit fusb302_handle_togdone_src would assume that the toggle-
engine always stopped at the CC pin indicating the polarity, IOW it assumed
that it stopped at the pin connected to Rd. It did check the CC-status of
that pin, but it did not expect to get a CC-status of Ra and therefore
treated this as CC-open. This lead to the following 2 problems:
1) If a powered cable/adapter gets plugged in with Ra on CC1 and Rd on CC2
then 4 of 5 times when plugged in toggling will stop with a togdone_result
of FUSB_REG_STATUS1A_TOGSS_SRC1. 3/5th of the time the toggle-engine is
testing for being connected as a sink and after that it tests 1/5th of the
time for connected as a src through CC1 before finally testing the last
1/5th of the time for being a src connected through CC2.
This was a problem because we would only check the CC pin status for the
pin on which the toggling stopped which in this polarity 4 out of 5
times would be the Ra pin. The code before this commit would treat Ra as
CC-open and then restart toggling. Once toggling is restarted we are
guaranteed to end with FUSB_REG_STATUS1A_TOGSS_SRC1 as CC1 is tested first,
leading to a CC-status of Ra again and an infinite restart toggling loop.
So 4 out of 5 times when plugged in in this polarity a powered adapter
will not work.
2) Even if we happen to have the right polarity or 1/5th of the time in
the polarity with problem 1), we would report the non Rd pin as CC-open
rather then as Ra, resulting in the tcpm.c code not enabling Vconn which
is a problem for some adapters.
This commit fixes this by getting the CC-status of *both* pins and then
determining the polarity based on that, rather then on where the toggling
stopped.
Change-Id: I533585441147cdc869381f96bcdfa05a5f451f8a
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 702ad49fb8)
The 2 callers of fusb302_set_cc_polarity both call fusb302_set_cc_pull
directly before calling fusb302_set_cc_polarity, this is not ideal for
2 reasons:
1) fusb302_set_cc_pull uses the cached polarity when applying the pull-ups,
which maybe changed immediately afterwards, to fix this set_cc_polarity
already does the pull-up setting.
2) Both touch the SWITCHES0 register in a r-w-modify cycle, this leads to
read reg, write reg, read reg, write reg. If we fold the setting of
the pull-downs into fusb302_set_cc_polarity then not only can we avoid
doing the reads / writes twice, at this point we set all bits, so we
can skip the read, turning 4 (slowish) i2c-transfers into 1.
Doing this also avoids the need to cache the pull_up state in
struct fusb302_chip.
Change-Id: I1e3687063ba4d1f8c321bf99cc2464c92300344a
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 31df7fadf5)
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/usb/typec/tcpm/tcpm.c: In function 'tcpm_pd_select_pps_apdo':
drivers/usb/typec/tcpm/tcpm.c:2212:39: warning:
variable 'snk_ma' set but not used [-Wunused-but-set-variable]
drivers/usb/typec/tcpm/tcpm.c: In function 'tcpm_pd_build_pps_request':
drivers/usb/typec/tcpm/tcpm.c:2405:37: warning:
variable 'min_mv' set but not used [-Wunused-but-set-variable]
Change-Id: I030bc96a2faca98946fa95b51c1dbdadbb9abc1b
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 8e4657c60c)
When the controller is configured for a fixed power role (Source
only or Sink only), attach does not proceed within the TCPM state
machine as there is no CC event generated by this driver to update
the CC line status.
To rectify this, when CC is configured as Source or Sink we now
make use of the hardware's automatic fixed Source or Sink
toggling mechanism, which detects attaches in the same way as for
DRP toggling. In this way the result of toggling is handled in the
same way by the 'fusb302_handle_togdone()' function, and CC events
are generated as expected for TCPM allowing a contract to be
established.
Change-Id: I736243adf0ddc9a11c00aa02be07c7039d26811d
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ea3b4d5523)
Moving all the drivers that depend on the Port Controller
Manager under a new directory drivers/usb/typec/tcpm/ and
making Guenter Roeck the designated reviewer of that code.
Change-Id: I72c3f00dc70b6a93dfc26c48b57635b96697305a
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ae8a2ca8a2)
The debugfs needs to be initialized as the last step in
probe in this case. The struct dentry *rootdir can't be
pointing to anything unless driver probe really finishes
successfully.
It is also not necessary to clear the i2c clientdata if the
probe fails, so removing the extra label used for that.
Change-Id: I07bbb25430921572231faf9dfac7328981055ff4
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit c800c51f58)
Variables snk_pdo and toggling_mode_name are defined but are not used and
hence can be removed.
Cleans up clang warnings:
warning: 'snk_pdo' defined but not used [-Wunused-const-variable=]
warning: 'toggling_mode_name' defined but not used [-Wunused-const-variable=]
Change-Id: I94d335fee54eda1a3e10ade5333a1db1a6c93336
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 697fa834c3)
RK1000's control register block need mclk for i2c communication.
So mclk should be enabled in advance.
RK1000's control register block should be registered before RK1000
TVE.
Change-Id: Iba9a2a410fe927666072f8d246995462a860ec3a
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
if iommu had paged, then skip the enable process.
Change-Id: I07ae8ca8e0836472f79dcabf7b14f5fbba4b8870
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
when iommu shared, such as px30 rk3368, each device power on affect
iommu usage_count add once. in this case, it should pm_runtime_put/get
by usage_count times,then hardware will really suspend/resume.
Change-Id: I7e57818e4eaf8af84e52c2d77030791329721c2e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
The function cpu_power_to_freq is used to find a frequency and set the
cooling device to consume at most the power to be converted. For example,
if the power to be converted is 80mW, and the em table is as follow.
struct em_cap_state table[] = {
/* KHz mW */
{ 1008000, 36, 0 },
{ 1200000, 49, 0 },
{ 1296000, 59, 0 },
{ 1416000, 72, 0 },
{ 1512000, 86, 0 },
};
The target frequency should be 1416000KHz, not 1512000KHz.
Fixes: 349d39dc57 ("thermal: cpu_cooling: merge frequency and power tables")
Link: https://patchwork.kernel.org/patch/11613103/
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia9d407787834f10190c8ba1e77ea1c23ed2bb25b
WARNING: modpost: missing MODULE_LICENSE() in drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.o
see include/linux/module.h for more information
Change-Id: Ie683a00a1d0c66633fa7c169179298b08ef95452
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>