#21889: 1-Wire, w1-gpio-custom, Failed to parse gpio property for data pin (-2)
(bcm963xx)
------------------------+-----------------------------------
  Reporter:  virtual@…  |      Owner:  developers
      Type:  defect     |     Status:  new
  Priority:  normal     |  Milestone:  Barrier Breaker 14.07
 Component:  kernel     |    Version:  Chaos Calmer 15.05
Resolution:             |   Keywords:  1wire w1-gpio
------------------------+-----------------------------------

Comment (by virtual@…):

 Probably it is not correct, but works.
 The example in linux-3.18.23/drivers/i2c/busses/i2c-gpio.c looked
  /* First get the GPIO pins; if it fails, we'll defer the probe. */

 linux-3.18.23/drivers/w1/masters/w1-gpio.c
 {{{
 static int w1_gpio_probe_dt(struct platform_device *pdev)
 {
         struct w1_gpio_platform_data *pdata =
 dev_get_platdata(&pdev->dev);
         struct device_node *np = pdev->dev.of_node;
         int gpio;

         pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
         if (!pdata)
                 return -ENOMEM;

         if (of_get_property(np, "linux,open-drain", NULL))
                 pdata->is_open_drain = 1;
 ++if (pdev->dev.of_node) {        /*(Virtual) of_node can be absent*/
         gpio = of_get_gpio(np, 0);
         if (gpio < 0) {
                 if (gpio != -EPROBE_DEFER)
                         dev_err(&pdev->dev,
                                         "Failed to parse gpio property for
 data pin (%d)\n",
                                         gpio);

                 return gpio;
         }
         pdata->pin = gpio;

         gpio = of_get_gpio(np, 1);
         if (gpio == -EPROBE_DEFER)
                 return gpio;
         /* ignore other errors as the pullup gpio is optional */
         pdata->ext_pullup_enable_pin = gpio;

         pdev->dev.platform_data = pdata;
 ++}
         return 0;
 }

 }}}

--
Ticket URL: <https://dev.openwrt.org/ticket/21889#comment:1>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to