Messages in this thread | | | Date | Tue, 22 Jul 2014 09:36:55 +0100 | From | Lee Jones <> | Subject | Re: [PATCH 2/4] mfd: imanager2: Add Advantech EC APIs support for IT8516/18/28 |
| |
On Mon, 14 Jul 2014, Wei-Chun Pan wrote:
You have to write a commit log here. What is this? Why is it needed? What problem does it solve? What happens if it's not provided? How is it implemented? Etc etc.
> Signed-off-by: Wei-Chun Pan <weichun.pan@advantech.com.tw> > --- > drivers/mfd/imanager2_ec.c | 615 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 615 insertions(+) > create mode 100644 drivers/mfd/imanager2_ec.c > > diff --git a/drivers/mfd/imanager2_ec.c b/drivers/mfd/imanager2_ec.c > new file mode 100644 > index 0000000..f7a0003 > --- /dev/null > +++ b/drivers/mfd/imanager2_ec.c > @@ -0,0 +1,615 @@ > +/* > + * imanager2_ec.c - MFD accessing driver of Advantech EC IT8516/18/28 > + * Copyright (C) 2014 Richard Vidal-Dorsch <richard.dorsch@advantech.com> > + * > + * This program is free software: you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation, either version 3 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program. If not, see <http://www.gnu.org/licenses/>.
I'd prefer if you used the short version.
> + */ > + > +#include <linux/io.h> > +#include <linux/delay.h>
I'm sure that you're missing a whole bunch of header files here. You are to include all files that you make use of in _this_ file.
> +#include <linux/mfd/imanager2_ec.h>
Comment this line out to see what is not defined. At the very least you will need export.h and err.h.
[...]
> +static int imanager2_read_mailbox(u32 ecflag, u8 offset, u8 *data) > +{ > + if (ecflag & EC_FLAG_IO_MAILBOX) { > + int ret = ec_wait_ibc0(); > + if (ret) > + return ret; > + inb(EC_IO_PORT_DATA); > + outb(offset + EC_IO_CMD_READ_OFFSET, EC_IO_PORT_CMD); > + > + return ec_inb_after_obf1(data); > + } else { > + outb(offset, EC_ITE_PORT_OFS); > + *data = inb(EC_ITE_PORT_DATA); > + } > + > + return 0; > +}
All of the Mailbox controller code in this file should live in drivers/mailbox.
Also, does your Mailbox controller support IRQs?
-- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |