diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index c9d687769e0677792bfa890c61be86124bf94644..da9dd9dbc0b7b36880320e5bd81eec2b7e0f1de1 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -51,8 +51,6 @@ #define extra_checks 0 #endif -#define dont_test_bit(b,d) (0) - /* Device and char device-related information */ static DEFINE_IDA(gpio_ida); static dev_t gpio_devt; @@ -2439,13 +2437,15 @@ int gpiod_direction_output(struct gpio_desc *desc, int value) value = !!value; /* GPIOs used for enabled IRQs shall not be set as output */ - if (dont_test_bit(FLAG_USED_AS_IRQ, &desc->flags) && - dont_test_bit(FLAG_IRQ_IS_ENABLED, &desc->flags)) { +#ifndef CONFIG_OPENEULER_RASPBERRYPI + if (test_bit(FLAG_USED_AS_IRQ, &desc->flags) && + test_bit(FLAG_IRQ_IS_ENABLED, &desc->flags)) { gpiod_err(desc, "%s: tried to set a GPIO tied to an IRQ as output\n", __func__); return -EIO; } +#endif if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { /* First see if we can enable open drain in hardware */ @@ -3245,13 +3245,15 @@ int gpiochip_lock_as_irq(struct gpio_chip *gc, unsigned int offset) } /* To be valid for IRQ the line needs to be input or open drain */ - if (dont_test_bit(FLAG_IS_OUT, &desc->flags) && - !dont_test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { +#ifndef CONFIG_OPENEULER_RASPBERRYPI + if (test_bit(FLAG_IS_OUT, &desc->flags) && + !test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { chip_err(gc, "%s: tried to flag a GPIO set as output for IRQ\n", __func__); return -EIO; } +#endif set_bit(FLAG_USED_AS_IRQ, &desc->flags); set_bit(FLAG_IRQ_IS_ENABLED, &desc->flags); diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index cfbcf3952ddc9839f03aadf91e2c6ca8530ecacb..6216623865b7199d770f43e6a78b7a08c8a22533 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -445,9 +445,13 @@ static int i2c_gpio_probe(struct platform_device *pdev) adap->dev.parent = dev; adap->dev.of_node = np; +#ifdef CONFIG_OPENEULER_RASPBERRYPI if (pdev->id != PLATFORM_DEVID_NONE || !pdev->dev.of_node || of_property_read_u32(pdev->dev.of_node, "reg", &adap->nr)) adap->nr = pdev->id; +#else + adap->nr = pdev->id; +#endif ret = i2c_bit_add_numbered_bus(adap); if (ret) return ret; diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 0b821a5b2db844ef44ccb9c60a96a10b9a2a29d2..03a534a8b55be9f52a67451fae234cb369e8d735 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -82,9 +82,16 @@ static void msg_submit(struct mbox_chan *chan) exit: spin_unlock_irqrestore(&chan->lock, flags); - if (!err && (chan->txdone_method & TXDONE_BY_POLL)) - /* kick start the timer immediately to avoid delays */ + /* kick start the timer immediately to avoid delays */ + if (!err && (chan->txdone_method & TXDONE_BY_POLL)) { +#ifdef CONFIG_OPENEULER_RASPBERRYPI hrtimer_start(&chan->mbox->poll_hrt, 0, HRTIMER_MODE_REL); +#else + /* but only if not already active */ + if (!hrtimer_active(&chan->mbox->poll_hrt)) + hrtimer_start(&chan->mbox->poll_hrt, 0, HRTIMER_MODE_REL); +#endif + } } static void tx_tick(struct mbox_chan *chan, int r) @@ -122,6 +129,9 @@ static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer) struct mbox_chan *chan = &mbox->chans[i]; if (chan->active_req && chan->cl) { +#ifndef CONFIG_OPENEULER_RASPBERRYPI + resched = true; +#endif txdone = chan->mbox->ops->last_tx_done(chan); if (txdone) tx_tick(chan, 0); diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c index 3acbe711b792f35c2be2aa451102176476eae2c6..a2a79ee38c3413e6bb2cdac804d8cef70ce6bb88 100644 --- a/drivers/power/reset/gpio-poweroff.c +++ b/drivers/power/reset/gpio-poweroff.c @@ -54,7 +54,9 @@ static int gpio_poweroff_probe(struct platform_device *pdev) bool export = false; /* If a pm_power_off function has already been added, leave it alone */ +#ifdef CONFIG_OPENEULER_RASPBERRYPI force = of_property_read_bool(pdev->dev.of_node, "force"); +#endif if (!force && (pm_power_off != NULL)) { dev_err(&pdev->dev, "%s: pm_power_off function already registered\n",