History

Merge tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij: "This is a late pinctrl fix pull request, we had to revert out the pinctrl-single GPIO backend, because of, well, design issues. We're cooking a better thing for the next cycle. - Revert gpio request/free backend, new patch set in the works, will be for v3.9. Get this old cruft out before anyone hurts himself on it. - Kconfig buzz - Various compile warnings - MPP6 value for the Kirkwood" * tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: nomadik: nmk_prcm_gpiocr_get_mode may be unused pinctrl: exynos: don't mark probing functions as __init Revert "pinctrl: single: support gpio request and free" pinctrl: mvebu: fix MPP6 value for kirkwood driver pinctrl: mvebu: Fix compiler warnings pinctrl: pinctrl-mxs: Fix variables' definition type pinctrl: samsung: removing duplicated condition for PINCTRL_SAMSUNG

Linus Torvalds committed 13 years ago

Commit d6a3bf92 parents 6abb7c2 0fafd507 files · +17 −94Browse files

Unified · Split

7 files
  1. drivers/pinctrl/Kconfig +0 −1
  2. drivers/pinctrl/mvebu/pinctrl-dove.c +1 −1
  3. drivers/pinctrl/mvebu/pinctrl-kirkwood.c +4 −4
  4. drivers/pinctrl/pinctrl-exynos5440.c +5 −5
  5. drivers/pinctrl/pinctrl-mxs.c +4 −5
  6. drivers/pinctrl/pinctrl-nomadik.c +1 −1
  7. drivers/pinctrl/pinctrl-single.c +2 −77
drivers/pinctrl/Kconfig+0−1
@@ -181,7 +181,6 @@ config PINCTRL_COH901 · 180 unmodified lines
181181
182182 config PINCTRL_SAMSUNG
183183 bool
184− depends on OF && GPIOLIB
185184 select PINMUX
186185 select PINCONF
187186
drivers/pinctrl/mvebu/pinctrl-dove.c+1−1
@@ -588,7 +588,7 @@ static int dove_pinctrl_probe(struct platform_device *pdev) · 587 unmodified lines
588588 {
589589 const struct of_device_id *match =
590590 of_match_device(dove_pinctrl_of_match, &pdev->dev);
591− pdev->dev.platform_data = match->data;
591+ pdev->dev.platform_data = (void *)match->data;
592592
593593 /*
594594 * General MPP Configuration Register is part of pdma registers.
drivers/pinctrl/mvebu/pinctrl-kirkwood.c+4−4
@@ -66,9 +66,9 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = { · 65 unmodified lines
6666 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
6767 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))),
6868 MPP_MODE(6,
69− MPP_VAR_FUNCTION(0x0, "sysrst", "out", V(1, 1, 1, 1, 1, 1)),
70− MPP_VAR_FUNCTION(0x1, "spi", "mosi", V(1, 1, 1, 1, 1, 1)),
71− MPP_VAR_FUNCTION(0x2, "ptp", "trig", V(1, 1, 1, 1, 0, 0))),
69+ MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1)),
70+ MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1)),
71+ MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))),
7272 MPP_MODE(7,
7373 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
7474 MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)),
@@ -458,7 +458,7 @@ static int kirkwood_pinctrl_probe(struct platform_device *pdev) · 383 unmodified lines
458458 {
459459 const struct of_device_id *match =
460460 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
461− pdev->dev.platform_data = match->data;
461+ pdev->dev.platform_data = (void *)match->data;
462462 return mvebu_pinctrl_probe(pdev);
463463 }
464464
drivers/pinctrl/pinctrl-exynos5440.c+5−5
@@ -599,7 +599,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse · 598 unmodified lines
599599 }
600600
601601 /* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */
602−static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
602+static int exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
603603 struct device_node *cfg_np, unsigned int **pin_list,
604604 unsigned int *npins)
605605 {
@@ -630,7 +630,7 @@ static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, · 24 unmodified lines
630630 * Parse the information about all the available pin groups and pin functions
631631 * from device node of the pin-controller.
632632 */
633−static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
633+static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
634634 struct exynos5440_pinctrl_priv_data *priv)
635635 {
636636 struct device *dev = &pdev->dev;
@@ -723,7 +723,7 @@ static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev, · 86 unmodified lines
723723 }
724724
725725 /* register the pinctrl interface with the pinctrl subsystem */
726−static int __init exynos5440_pinctrl_register(struct platform_device *pdev,
726+static int exynos5440_pinctrl_register(struct platform_device *pdev,
727727 struct exynos5440_pinctrl_priv_data *priv)
728728 {
729729 struct device *dev = &pdev->dev;
@@ -798,7 +798,7 @@ static int __init exynos5440_pinctrl_register(struct platform_device *pdev, · 68 unmodified lines
798798 }
799799
800800 /* register the gpiolib interface with the gpiolib subsystem */
801−static int __init exynos5440_gpiolib_register(struct platform_device *pdev,
801+static int exynos5440_gpiolib_register(struct platform_device *pdev,
802802 struct exynos5440_pinctrl_priv_data *priv)
803803 {
804804 struct gpio_chip *gc;
@@ -831,7 +831,7 @@ static int __init exynos5440_gpiolib_register(struct platform_device *pdev, · 26 unmodified lines
831831 }
832832
833833 /* unregister the gpiolib interface with the gpiolib subsystem */
834−static int __init exynos5440_gpiolib_unregister(struct platform_device *pdev,
834+static int exynos5440_gpiolib_unregister(struct platform_device *pdev,
835835 struct exynos5440_pinctrl_priv_data *priv)
836836 {
837837 int ret = gpiochip_remove(priv->gc);
drivers/pinctrl/pinctrl-mxs.c+4−5
@@ -146,7 +146,7 @@ free: · 145 unmodified lines
146146 static void mxs_dt_free_map(struct pinctrl_dev *pctldev,
147147 struct pinctrl_map *map, unsigned num_maps)
148148 {
149− int i;
149+ u32 i;
150150
151151 for (i = 0; i < num_maps; i++) {
152152 if (map[i].type == PIN_MAP_TYPE_MUX_GROUP)
@@ -203,7 +203,7 @@ static int mxs_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned selector, · 50 unmodified lines
203203 void __iomem *reg;
204204 u8 bank, shift;
205205 u16 pin;
206− int i;
206+ u32 i;
207207
208208 for (i = 0; i < g->npins; i++) {
209209 bank = PINID_TO_BANK(g->pins[i]);
@@ -256,7 +256,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev, · 46 unmodified lines
256256 void __iomem *reg;
257257 u8 ma, vol, pull, bank, shift;
258258 u16 pin;
259− int i;
259+ u32 i;
260260
261261 ma = CONFIG_TO_MA(config);
262262 vol = CONFIG_TO_VOL(config);
@@ -345,8 +345,7 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev, · 82 unmodified lines
345345 const char *propname = "fsl,pinmux-ids";
346346 char *group;
347347 int length = strlen(np->name) + SUFFIX_LEN;
348− int i;
349− u32 val;
348+ u32 val, i;
350349
351350 group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL);
352351 if (!group)
drivers/pinctrl/pinctrl-nomadik.c+1−1
@@ -676,7 +676,7 @@ int nmk_gpio_set_mode(int gpio, int gpio_mode) · 675 unmodified lines
676676 }
677677 EXPORT_SYMBOL(nmk_gpio_set_mode);
678678
679−static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)
679+static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)
680680 {
681681 int i;
682682 u16 reg;
drivers/pinctrl/pinctrl-single.c+2−77
@@ -30,7 +30,6 @@ · 29 unmodified lines
3030 #define PCS_MUX_BITS_NAME "pinctrl-single,bits"
3131 #define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1)
3232 #define PCS_OFF_DISABLED ~0U
33−#define PCS_MAX_GPIO_VALUES 2
3433
3534 /**
3635 * struct pcs_pingroup - pingroups for a function
@@ -77,16 +76,6 @@ struct pcs_function { · 40 unmodified lines
7776 struct list_head node;
7877 };
7978
80−/**
81− * struct pcs_gpio_range - pinctrl gpio range
82− * @range: subrange of the GPIO number space
83− * @gpio_func: gpio function value in the pinmux register
84− */
85−struct pcs_gpio_range {
86− struct pinctrl_gpio_range range;
87− int gpio_func;
88−};
89−
9079 /**
9180 * struct pcs_data - wrapper for data needed by pinctrl framework
9281 * @pa: pindesc array
@@ -414,26 +403,9 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector, · 321 unmodified lines
414403 }
415404
416405 static int pcs_request_gpio(struct pinctrl_dev *pctldev,
417− struct pinctrl_gpio_range *range, unsigned pin)
406+ struct pinctrl_gpio_range *range, unsigned offset)
418407 {
419− struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
420− struct pcs_gpio_range *gpio = NULL;
421− int end, mux_bytes;
422− unsigned data;
423−
424− gpio = container_of(range, struct pcs_gpio_range, range);
425− end = range->pin_base + range->npins - 1;
426− if (pin < range->pin_base || pin > end) {
427− dev_err(pctldev->dev,
428− "pin %d isn't in the range of %d to %d\n",
429− pin, range->pin_base, end);
430− return -EINVAL;
431− }
432− mux_bytes = pcs->width / BITS_PER_BYTE;
433− data = pcs->read(pcs->base + pin * mux_bytes) & ~pcs->fmask;
434− data |= gpio->gpio_func;
435− pcs->write(data, pcs->base + pin * mux_bytes);
436− return 0;
408+ return -ENOTSUPP;
437409 }
438410
439411 static struct pinmux_ops pcs_pinmux_ops = {
@@ -907,49 +879,6 @@ static void pcs_free_resources(struct pcs_device *pcs) · 467 unmodified lines
907879
908880 static struct of_device_id pcs_of_match[];
909881
910−static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs)
911−{
912− struct pcs_gpio_range *gpio;
913− struct device_node *child;
914− struct resource r;
915− const char name[] = "pinctrl-single";
916− u32 gpiores[PCS_MAX_GPIO_VALUES];
917− int ret, i = 0, mux_bytes = 0;
918−
919− for_each_child_of_node(node, child) {
920− ret = of_address_to_resource(child, 0, &r);
921− if (ret < 0)
922− continue;
923− memset(gpiores, 0, sizeof(u32) * PCS_MAX_GPIO_VALUES);
924− ret = of_property_read_u32_array(child, "pinctrl-single,gpio",
925− gpiores, PCS_MAX_GPIO_VALUES);
926− if (ret < 0)
927− continue;
928− gpio = devm_kzalloc(pcs->dev, sizeof(*gpio), GFP_KERNEL);
929− if (!gpio) {
930− dev_err(pcs->dev, "failed to allocate pcs gpio\n");
931− return -ENOMEM;
932− }
933− gpio->range.name = devm_kzalloc(pcs->dev, sizeof(name),
934− GFP_KERNEL);
935− if (!gpio->range.name) {
936− dev_err(pcs->dev, "failed to allocate range name\n");
937− return -ENOMEM;
938− }
939− memcpy((char *)gpio->range.name, name, sizeof(name));
940−
941− gpio->range.id = i++;
942− gpio->range.base = gpiores[0];
943− gpio->gpio_func = gpiores[1];
944− mux_bytes = pcs->width / BITS_PER_BYTE;
945− gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes;
946− gpio->range.npins = (r.end - r.start) / mux_bytes + 1;
947−
948− pinctrl_add_gpio_range(pcs->pctl, &gpio->range);
949− }
950− return 0;
951−}
952−
953882 static int pcs_probe(struct platform_device *pdev)
954883 {
955884 struct device_node *np = pdev->dev.of_node;
@@ -1046,10 +975,6 @@ static int pcs_probe(struct platform_device *pdev) · 90 unmodified lines
1046975 goto free;
1047976 }
1048977
1049− ret = pcs_add_gpio_range(np, pcs);
1050− if (ret < 0)
1051− goto free;
1052−
1053978 dev_info(pcs->dev, "%i pins at pa %p size %u\n",
1054979 pcs->desc.npins, pcs->base, pcs->size);
1055980

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t