From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965040AbeE2QbJ (ORCPT ); Tue, 29 May 2018 12:31:09 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35381 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935486AbeE2QbG (ORCPT ); Tue, 29 May 2018 12:31:06 -0400 X-Google-Smtp-Source: ADUXVKKzpeieq8B/xszgny4UnrE/Z60KE5noz2XXUs4T46R9CaO8PJuIpS/Y+K5nZF+LBjTaE8VnWVK9xChA2JOe03U= MIME-Version: 1.0 References: <20180529131014.18641-1-ricardo.ribalda@gmail.com> <20180529131014.18641-8-ricardo.ribalda@gmail.com> In-Reply-To: From: Ricardo Ribalda Delgado Date: Tue, 29 May 2018 18:30:48 +0200 Message-ID: Subject: Re: [PATCH 07/19] serdev: Allows dynamic creation of devices via sysfs To: Rob Herring Cc: LKML , "open list:SERIAL DRIVERS" , Johan Hovold , Greg Kroah-Hartman , Jiri Slaby , Wolfram Sang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob On Tue, May 29, 2018 at 5:38 PM Rob Herring wrote: > On Tue, May 29, 2018 at 8:10 AM, Ricardo Ribalda Delgado > wrote: > > Allow creating and deleting devices via sysfs. Devices created will be > > matched to serdev drivers via modalias (the string provided by the user) > > and deleted via their name. Eg: > > > > # Create device > > root@qt5022:~# echo ttydev > /sys/bus/serial/devices/serial0/new_device > > > > # Delete device > > root@qt5022:~# > > echo serial0-0 > /sys/bus/serial/devices/serial0/delete_device > I think the model here should be the kernel provides dummy slave > device for each serial port and then you can use bind and unbind to > bind to a particular driver. I have been researching a bit that approach, but I found a couple of issues: - With the bind/unbind you need to modprobe manually the module. Something like modprobe myserdev echo myserdev > bind - You need one module per part_number, with modalias you can have a different alias per module - I guess that the final user will appreciate that the serdev has the same API as other serial slow bus (i2c). ccing Wolfram becase maybe he has some feedback to same from his experience with the i2c bus. Thanks! > Rob -- Ricardo Ribalda