[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfish-on-dontbeevil/kernel-adaptation-pine64.git</param>
<param name="branch">main</param>
- <param name="revision">6.5.0+git3</param>
+ <param name="revision">6.5.2+git1</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/arch/arm64/boot/dts/rockchip/rk3566-pinetab2.dtsi
^
|
@@ -595,6 +595,7 @@
rockchip,resistor-sense-micro-ohms = <10000>;
rockchip,sleep-enter-current-microamp = <300000>;
rockchip,sleep-filter-current-microamp = <100000>;
+ power-supplies = <&usbc0>;
};
};
};
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts
^
|
@@ -163,6 +163,16 @@
vin-supply = <&vcc5v0_sys>;
};
+ vcc3v3_pcie_eth: vcc3v3-pcie-eth {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc3v3_pcie_eth";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
+ startup-delay-us = <50000>;
+ vin-supply = <&vcc5v0_sys>;
+ };
+
vcc3v3_wf: vcc3v3-wf {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_wf";
@@ -336,14 +346,14 @@
/* phy2 - right ethernet port */
&pcie2x1l1 {
reset-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
- //vpcie3v3-supply = <&vcc3v3_pcie_eth>;
+ vpcie3v3-supply = <&vcc3v3_pcie_eth>;
status = "okay";
};
/* phy0 - left ethernet port */
&pcie2x1l2 {
reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
- //vpcie3v3-supply = <&vcc3v3_pcie_eth>;
+ vpcie3v3-supply = <&vcc3v3_pcie_eth>;
status = "okay";
};
@@ -1128,26 +1138,11 @@
&pcie3x4 {
// 4 b5 wake / 4 b4 clkreq
};
-*/
-/*
+
sdmmc {
sdmmc_pwr: sdmmc_pwr {
rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
};
};
-
-/ {
- //XXX: this is ethernet_power in schematic, but doesn't enable anything?
- vcc3v3_pcie_eth: vcc3v3-pcie-eth {
- compatible = "regulator-fixed";
- regulator-name = "vcc3v3_pcie_eth";
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
- startup-delay-us = <50000>;
- vin-supply = <&vcc5v0_sys>;
- };
-
-};
*/
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/drivers/power/supply/rk817_charger.c
^
|
@@ -53,6 +53,7 @@
struct power_supply *chg_ps;
bool plugged_in;
bool battery_present;
+ bool apply_ilim;
/*
* voltage_k and voltage_b values are used to calibrate the ADC
@@ -677,6 +678,38 @@
}
+/* Sync the input-current-limit with our parent supply (if we have one) */
+static void rk817_usb_power_external_power_changed(struct power_supply *psy)
+{
+ struct rk817_charger *charger = power_supply_get_drvdata(psy);
+ union power_supply_propval val;
+ int ret;
+
+ ret = power_supply_get_property_from_supplier(charger->chg_ps,
+ POWER_SUPPLY_PROP_CURRENT_MAX,
+ &val);
+ if (ret)
+ return;
+
+ /*
+ * We only want to start applying input current limit after we get first
+ * non-0 value from the supplier. Until then, we keep the limit applied
+ * by the bootloader. If we lower the limit before the charger is properly
+ * detected, we risk boot failure due to insufficient power.
+ */
+ if (!charger->apply_ilim) {
+ if (!val.intval)
+ return;
+
+ charger->apply_ilim = true;
+ }
+
+ if (val.intval < 500000)
+ val.intval = 500000;
+
+ rk817_chg_set_prop(charger->chg_ps, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val);
+}
+
static irqreturn_t rk817_plug_in_isr(int irq, void *cg)
{
struct rk817_charger *charger;
@@ -784,6 +817,7 @@
.property_is_writeable = rk817_charger_prop_writeable,
.get_property = rk817_chg_get_prop,
.set_property = rk817_chg_set_prop,
+ .external_power_changed = rk817_usb_power_external_power_changed,
};
static int rk817_read_battery_nvram_values(struct rk817_charger *charger)
@@ -1207,13 +1241,13 @@
charger->bat_ps = devm_power_supply_register(&pdev->dev,
&rk817_bat_desc, &pscfg);
if (IS_ERR(charger->bat_ps))
- return dev_err_probe(dev, -EINVAL,
+ return dev_err_probe(dev, PTR_ERR(charger->bat_ps),
"Battery failed to probe\n");
charger->chg_ps = devm_power_supply_register(&pdev->dev,
&rk817_chg_desc, &pscfg);
if (IS_ERR(charger->chg_ps))
- return dev_err_probe(dev, -EINVAL,
+ return dev_err_probe(dev, PTR_ERR(charger->chg_ps),
"Charger failed to probe\n");
ret = power_supply_get_battery_info(charger->bat_ps,
@@ -1281,6 +1315,8 @@
/* Force the first update immediately. */
mod_delayed_work(system_wq, &charger->work, 0);
+ rk817_usb_power_external_power_changed(charger->chg_ps);
+
return 0;
}
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/drivers/usb/gadget/function/f_ecm.c
^
|
@@ -920,7 +920,9 @@
static void ecm_unbind(struct usb_configuration *c, struct usb_function *f)
{
- struct f_ecm *ecm = func_to_ecm(f);
+ struct f_ecm *ecm = func_to_ecm(f);
+ struct f_ecm_opts *opts = container_of(f->fi, struct f_ecm_opts,
+ func_inst);
DBG(c->cdev, "ecm unbind\n");
@@ -933,6 +935,8 @@
kfree(ecm->notify_req->buf);
usb_ep_free_request(ecm->notify, ecm->notify_req);
+
+ gether_set_gadget(opts->net, NULL);
}
static struct usb_function *ecm_alloc(struct usb_function_instance *fi)
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/drivers/usb/gadget/function/f_eem.c
^
|
@@ -260,9 +260,12 @@
* with list_for_each_entry, so we assume no race condition
* with regard to eem_opts->bound access
*/
+ mutex_lock(&eem_opts->lock);
+ gether_set_gadget(eem_opts->net, cdev->gadget);
+ mutex_unlock(&eem_opts->lock);
+
if (!eem_opts->bound) {
mutex_lock(&eem_opts->lock);
- gether_set_gadget(eem_opts->net, cdev->gadget);
status = gether_register_netdev(eem_opts->net);
mutex_unlock(&eem_opts->lock);
if (status)
@@ -637,9 +640,14 @@
static void eem_unbind(struct usb_configuration *c, struct usb_function *f)
{
+ struct f_eem_opts *opts = container_of(f->fi, struct f_eem_opts,
+ func_inst);
+
DBG(c->cdev, "eem unbind\n");
usb_free_all_descriptors(f);
+
+ gether_set_gadget(opts->net, NULL);
}
static struct usb_function *eem_alloc(struct usb_function_instance *fi)
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/drivers/usb/gadget/function/f_ncm.c
^
|
@@ -1438,9 +1438,12 @@
* with list_for_each_entry, so we assume no race condition
* with regard to ncm_opts->bound access
*/
+ mutex_lock(&ncm_opts->lock);
+ gether_set_gadget(ncm_opts->net, cdev->gadget);
+ mutex_unlock(&ncm_opts->lock);
+
if (!ncm_opts->bound) {
mutex_lock(&ncm_opts->lock);
- gether_set_gadget(ncm_opts->net, cdev->gadget);
status = gether_register_netdev(ncm_opts->net);
mutex_unlock(&ncm_opts->lock);
if (status)
@@ -1667,6 +1670,8 @@
static void ncm_unbind(struct usb_configuration *c, struct usb_function *f)
{
struct f_ncm *ncm = func_to_ncm(f);
+ struct f_ncm_opts *opts = container_of(f->fi, struct f_ncm_opts,
+ func_inst);
DBG(c->cdev, "ncm unbind\n");
@@ -1685,6 +1690,8 @@
kfree(ncm->notify_req->buf);
usb_ep_free_request(ncm->notify, ncm->notify_req);
+
+ gether_set_gadget(opts->net, NULL);
}
static struct usb_function *ncm_alloc(struct usb_function_instance *fi)
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/drivers/usb/gadget/function/f_rndis.c
^
|
@@ -701,9 +701,14 @@
* with list_for_each_entry, so we assume no race condition
* with regard to rndis_opts->bound access
*/
+ mutex_lock(&rndis_opts->lock);
+ gether_set_gadget(rndis_opts->net, cdev->gadget);
+ mutex_unlock(&rndis_opts->lock);
+
if (!rndis_opts->bound) {
- gether_set_gadget(rndis_opts->net, cdev->gadget);
+ mutex_lock(&rndis_opts->lock);
status = gether_register_netdev(rndis_opts->net);
+ mutex_unlock(&rndis_opts->lock);
if (status)
goto fail;
rndis_opts->bound = true;
@@ -969,7 +974,9 @@
static void rndis_unbind(struct usb_configuration *c, struct usb_function *f)
{
- struct f_rndis *rndis = func_to_rndis(f);
+ struct f_rndis *rndis = func_to_rndis(f);
+ struct f_rndis_opts *opts = container_of(f->fi, struct f_rndis_opts,
+ func_inst);
kfree(f->os_desc_table);
f->os_desc_n = 0;
@@ -977,6 +984,8 @@
kfree(rndis->notify_req->buf);
usb_ep_free_request(rndis->notify, rndis->notify_req);
+
+ gether_set_gadget(opts->net, NULL);
}
static struct usb_function *rndis_alloc(struct usb_function_instance *fi)
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/drivers/usb/gadget/function/f_subset.c
^
|
@@ -308,9 +308,12 @@
* with list_for_each_entry, so we assume no race condition
* with regard to gether_opts->bound access
*/
+ mutex_lock(&gether_opts->lock);
+ gether_set_gadget(gether_opts->net, cdev->gadget);
+ mutex_unlock(&gether_opts->lock);
+
if (!gether_opts->bound) {
mutex_lock(&gether_opts->lock);
- gether_set_gadget(gether_opts->net, cdev->gadget);
status = gether_register_netdev(gether_opts->net);
mutex_unlock(&gether_opts->lock);
if (status)
@@ -458,8 +461,13 @@
static void geth_unbind(struct usb_configuration *c, struct usb_function *f)
{
+ struct f_gether_opts *opts = container_of(f->fi, struct f_gether_opts,
+ func_inst);
+
geth_string_defs[0].id = 0;
usb_free_all_descriptors(f);
+
+ gether_set_gadget(opts->net, NULL);
}
static struct usb_function *geth_alloc(struct usb_function_instance *fi)
|
[-]
[+]
|
Changed |
_service:tar_git:kernel-adaptation-pine64-6.5.2+git1.tar.bz2/linux/drivers/usb/gadget/function/u_ether.c
^
|
@@ -788,7 +788,6 @@
net->max_mtu = GETHER_MAX_MTU_SIZE;
dev->gadget = g;
- SET_NETDEV_DEV(net, &g->dev);
SET_NETDEV_DEVTYPE(net, &gadget_type);
status = register_netdev(net);
@@ -861,8 +860,6 @@
struct usb_gadget *g;
int status;
- if (!net->dev.parent)
- return -EINVAL;
dev = netdev_priv(net);
g = dev->gadget;
@@ -893,7 +890,6 @@
dev = netdev_priv(net);
dev->gadget = g;
- SET_NETDEV_DEV(net, &g->dev);
}
EXPORT_SYMBOL_GPL(gether_set_gadget);
|